Support » Fixing WordPress » Finding first parent category id from post but excluding a specific category

  • On my single.php I have a sidebar for a wp_list_pages sub menu using hiearchic categories).

    I have posts that have more than one category that goe to the single.php page. I wish to identify the parent category slug (or id) of the first category of the post on single.php that is not the category ‘quicklink’.

    e.g. post has quicklink and News categories.
    News has a parent category of Events

    I want to display a sub menu using all the child categories of Events.

    I am stumped and would be very grateful if somebody could help me!

  • The topic ‘Finding first parent category id from post but excluding a specific category’ is closed to new replies.