WordPress.org

Ready to get started?Download WordPress

Forums

Getting the posts current category ID (2 posts)

  1. dizzy100
    Member
    Posted 6 years ago #

    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 ?

  2. MacDoodle
    Member
    Posted 6 years ago #

    Was there ever any resolution to this? I'm having the same problem. Need to get the current post category id.

    Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.