WordPress.org

Support

Support » Themes and Templates » Get the current pages Category id

Get the current pages Category id

  • how do i get the current pages category_id ?

    i want to get the category_id of current category page.

    i am using seperate template for category archives called category.php

    How do i get it working?

Viewing 1 replies (of 1 total)
  • If you want to have different layouts per category, create a file named category-1.php (where the category id=1, etc), then, query for that category just before the loop:


    <?php
    query_posts("cat=13&order=ASC");
    ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    does that help?

Viewing 1 replies (of 1 total)
  • The topic ‘Get the current pages Category id’ is closed to new replies.
Skip to toolbar