Skip to:
Content
Pages
Categories
Search
Top
Bottom

Serving menu based on forum parent


  • slidster@shadowpro.com.au
    Participant

    @slidstershadowprocomau

    I am building a site that is constructed of hubs with a parent forum as the base.

    At the moment I serve a different menu to /PARENT1/ and /PARENT2/ and that works fine until they go into a topic as then the /PARENTX/ slug disappears, along with the parent menu.

    Is there a way I can find out which parent forum the user is in to serve a set menu or header?

Viewing 1 replies (of 1 total)

  • slidster@shadowpro.com.au
    Participant

    @slidstershadowprocomau

    Figured it out finally.

    `”39″ is the page ID of the parent

    if ( is_singular() || bbp_is_forum_edit() || bbp_is_topic_edit() || bbp_is_reply_edit() )
    $ancestors = array_reverse( (array) get_post_ancestors( get_the_ID() ) );
    //$parent = get_post( $parent_id );
    if (in_array(’39′, $ancestors))
    //if ($ancestors == 39)
    {
    echo ‘blahblah’
    } `

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.