WordPress.org

Ready to get started?Download WordPress

Forums

Detecting Current Category... (2 posts)

  1. sithicus
    Member
    Posted 7 years ago #

    Is there a way to use use:

    wp_list_cats('child_of=#')

    and inject the current category into # so I do not have to create a million category pages?

    I basically have a static left menu but then wanted to show the subcategories for the category page that I am currently on

  2. Kafkaesqui

    Posted 7 years ago #

    $cat is a global variable that's hanging around on category queries. So try:

    wp_list_cats("child_of=$cat")

    It's likely you'll want to list the child categories of a parent *even* when you're in one of the child category listings. If so, see this post:

    http://wordpress.org/support/topic/45095#post-471616

Topic Closed

This topic has been closed to new replies.

About this Topic