Viewing 2 replies - 1 through 2 (of 2 total)
  • It already is: $cat is a global variable in WordPress that holds the category ID for a category query.

    I’m no php expert but:

    You can access the current category from the global variable $cat . I’ve used it before but for example <?php $my_variable = $cat; ?> I cant seem to get to it right now but http://codex.wordpress.org will have information on it if you just search for $cat .

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘current category ID into a variable’ is closed to new replies.