WordPress.org

Support

Support » How-To and Troubleshooting » Archive page and tags

Archive page and tags

  • jessn
    Participant

    @jessn

    Hey guys! I have an archives page and it’s set up to show a list of categories and how many posts they contain. However when someone clicks on one of the tags listed by the_tags instead I want the archives page to show all posts that have that tag. I’m just not sure how to write the conditional statement “if it’s a tag archive, do this, otherwise do this”.

    Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Look at the is_tag() conditional.

    jessn
    Participant

    @jessn

    Thanks, yep I got that. <?php if ( is_tag() ) { ?>

    Now I’m having a problem with the monthly archives. It’s showing the months, but when I click on one it just pulls up all posts written, instead of those written in that month. It could be because I have it excluding a few categories maybe? Any idea what I’m doing wrong?

    <h2>Monthly Archive Of <?php the_time('F Y'); ?></h2>
    <?php query_posts('cat=-11,-23'); ?>

    Can only guess this would work:

    <h2>Monthly Archive Of <?php the_time('F Y'); ?></h2>
    <?php query_posts($query_string . '&cat=-11,-23'); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Archive page and tags’ is closed to new replies.