Aztix (@aztix)

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • @aztix

    Participant

    Hi Robin,

    and thanks again answering me 🙂

    $forum_id = bbp_get_topic_forum_id($post_id);
    This line don’t get the parent forum, it get the current forum. Cause i created forums -> subforum -> topics

    I change a little my function, and now this is perfect, the menu is displayed on the right forum and all his topics.

    But now my problem is that this menu is displayed on the top of my page and not instead of the main menu of wordpress…

    here is my new function :

    `if (bbp_is_single_topic() && $parent_id == ‘forum_parent_11801’){
    wp_nav_menu(array(‘theme_location’ => ‘avia’, ‘menu’=>’menu-frenchtis-life’ ));
    }

    Do you know how can i replace the main menu by the good one ?

    in the function i right :
    ‘theme_location’ => ‘avia’

    This line must place my menu instead of the main menu no ?

    @aztix

    Participant

    Here is my research :

    I register the forum parent id with this :

    $parents = get_post_ancestors( $post->ID );
    $id = ($parents) ? $parents[count($parents)-1]: $post->ID;
    $parent_id = "forum_parent_".$id;

    and add it on my body class

    <?php body_class($parent_id." ".$style." ....) ?>

    and then i creat this little function :

    if (bbp_is_single_topic($parent_id === ‘forum_parent_11801’)){
    wp_nav_menu(array(‘theme_location’ => ‘primary’, ‘menu’=>’my-menu-name’ ));
    }

    It doesn’t work but i think that i’am not so far from what i want !

    @aztix

    Participant

    Hi Robin,

    thanks answering me 🙂

    I want all new topics created in a forum takes the menu of this forum.
    For exemple :

    MENU 1 ON :
    SITE 1
    – FORUM 1
    — TOPICS
    — TOPICS

    ***********************

    MENU 2 ON :
    SITE 2
    – FORUM 2
    –TOPICS
    –TOPICS

    etc…

    Do you understand what i’m tring to say ? :p I hope you can understand my english 🙂
    Thanks in advance !

Viewing 3 replies - 1 through 3 (of 3 total)