ThemeShaper Forums » Thematic

[closed]

Make a page of all posts with two specific tags

(2 posts)
  • Started 3 years ago by natevolk
  • Latest reply from middlesister
  • This topic is not resolved
  1. Okay, newbie here. How do I make a page that will show excerpts of all posts tagged with tags "X" and tags "Y"? Or even better yet, a page that displays a certain category "A" but only posts that have been tagged "X" and "Y"? Thanks everyone!

    Posted 3 years ago #
  2. middlesister
    Member

    You can do this by adjusting the post query.

    Duplicate the blog page template, rename it to something useful, change the Template Name at the top to your new name and replace the line

    $wp_query->query( array( 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => $paged ) );

    with

    $args = array(
        'posts_per_page' => get_option( 'posts_per_page' ),
        'paged' => $paged,
        'category_name' => 'NAME',
        'tag_slug__and' => array( 'TAG1', 'TAG2' )
    );
    $wp_query->query( $args );

    Then you can give your page this page template and bob's your uncle!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.