WordPress.org

Support

Support » Plugins and Hacks » Hacks » Calling Current Category?

Calling Current Category?

  • Hi All,

    Working on my first wordpress site and have a quick question I’ve got the following code:
    (archive.php)

    <?php
    $cat_id = get_query_var('cat');                     query_posts('category_name=$cat_id');                     if (have_posts()) : while (have_posts()) : the_post();                          if( get_the_tag_list() ){                             echo $posttags = get_the_tag_list('<li>','</li><li>','</li>');                         }                      endwhile; endif;                       wp_reset_query();                  ?>

    What I’m trying to do here is to call the tags of the current category.

    EG: http://mysite.com/?cat=10
    I will get a list of tags used in posts in the category with the id of 10.

    I’m sure I’m just making a stupid error here any help appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Calling Current Category?’ is closed to new replies.
Skip to toolbar