Support » How-To and Troubleshooting » Getting the posts current category ID

Getting the posts current category ID

  • dizzy100


    Ok ive tried lots and lots of things, searched extensively here and tried more sql than I care to think of but this is beyond me.

    I have posts that are in multiple child categories but i want to display some random posts from the currently active posts child category. So all i need is to retrieve that posts currently active child category ID.

    I’ve tried the global $cat but that just returns the parent category and not the currently viewed child category.

    Is there anyway to retrieve the current viewed posts child category id ?

Viewing 1 replies (of 1 total)
  • Was there ever any resolution to this? I’m having the same problem. Need to get the current post category id.


Viewing 1 replies (of 1 total)
  • The topic ‘Getting the posts current category ID’ is closed to new replies.