• I am trying to complete a query on a post type which returns all posts that match the query criteria (e.g. in a specific taxonomy term) as an array with key value pairs like so:

    array(
      'A post Title' = >'This is some post content',
      'Another Post Title' => 'Some more post content'
    );

    get_posts will allow me to get the post data for each post, my problem is how to pull out the title and content and the construct the array.

    Any help would be much appreciated and thanks in advance.

  • The topic ‘Key Value Pairing Array of Post Title and Content’ is closed to new replies.