Forums

archive.php filter category AND tag (2 posts)

  1. roakin
    Member
    Posted 1 year ago #

    i need an archive.php template where i can list either posts from a given category (witch is no problem) or posts with a given tag (witch is no problem too) or all posts within a given category AND a given tag ... ist this combination possible?

    thx in advance

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Yes - it's possible. Something like:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'News',
             'tag' => 'wibble',
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    should do it.

Topic Closed

This topic has been closed to new replies.

About this Topic