WordPress.org

Ready to get started?Download WordPress

Forums

Finding first parent category id from post but excluding a specific category (1 post)

  1. hennyc
    Member
    Posted 7 months ago #

    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!

Reply

You must log in to post.

About this Topic