• Resolved jnui

    (@jnui)


    I want to retrieve posts that are in a particular category, and also have a particular tag.
    for example – I want to get all posts in the “news” category that are tagged with “Madonna”.

    I know that get_posts() does either category_name or tag , but how would I achieve this list if I want both?
    I want it ordered chronologically, most recent first.

    cheers

Viewing 1 replies (of 1 total)
  • Thread Starter jnui

    (@jnui)

    don’t worry, figured it out.

    $args = array( 'numberposts' => 3, 'category_name' => 'news', 'tag'=>'madonna' );
    get_posts($args);
Viewing 1 replies (of 1 total)
  • The topic ‘get_posts() , how do i mix category and tags?’ is closed to new replies.