Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #274920

    Febs
    Participant

    Hi,

    Is it possible to add text into the bbpress icon menu? I would like to add “Forum” text after the speech bubble icon.
    this is the menu i’m talking about. If its possible, how do I add that? also is it possible to reorder it from the wp menu?

    #274921

    Febs
    Participant
    This reply has been marked as private.
    #274922

    Christopher
    Moderator

    Hi there,

    Yes, under Appearance -> Menus find this menu item and add your text in navigation label just after icon code.

    You can also drag and drop menu items in order to change their order.

    Thanks.

    #274943

    Febs
    Participant

    I know that and I’ve already tried to find the forum menu but Im unable to find anything there. Screenshot below.

    https://copy.com/rStuIyi8DWPAafW0

    Where can I find it?

    #274947

    Christopher
    Moderator

    Hi there,

    Sorry for confusion, the bbpress menu activate from customizer, to add text after this icon add the following CSS under Customize -> Custom -> CSS :

    a.x-btn-navbar-bbpress:after {
      content: "bbpress";
    }

    Thanks.

    #275009

    Febs
    Participant

    Thanks for the suggestion. How do I make it visible on in the “appearance > menu” page? I would like to change the order of the menu.

    #275126

    Rad
    Moderator

    Hi there,

    Sorry for the confusion. BBpress menu items are added automatically if enabled through customizer. It’s not something that can be manage from Appearance > Menus.

    You can maybe add text, but you can’t order them just like normal menu items.

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Add this code at your child theme’s functions.php with your own texts.

    if ( ! function_exists( 'x_bbpress_navbar_menu' ) ) :
      function x_bbpress_navbar_menu( $items, $args ) {
    
        if ( X_BBPRESS_IS_ACTIVE && x_get_option( 'x_bbpress_header_menu_enable', '' ) == '1' ) {
    
          $submenu_items  = '';
          $submenu_items .= '<li class="menu-item menu-item-bbpress-navigation"><a href="' . bbp_get_search_url() . '" class="cf"><i class="x-icon x-icon-search"></i> <span>' . __( 'Forums Search', '__x__' ) . '</span></a></li>';
    
          if ( is_user_logged_in() ) {
            $submenu_items .= '<li class="menu-item menu-item-bbpress-navigation"><a href="' . bbp_get_favorites_permalink( get_current_user_id() ) . '" class="cf"><i class="x-icon x-icon-star"></i> <span>' . __( 'Favorites', '__x__' ) . '</span></a></li>';
            $submenu_items .= '<li class="menu-item menu-item-bbpress-navigation"><a href="' . bbp_get_subscriptions_permalink( get_current_user_id() ) . '" class="cf"><i class="x-icon x-icon-bookmark"></i> <span>' . __( 'Subscriptions', '__x__' ) . '</span></a></li>';
          }
    
          if ( ! X_BUDDYPRESS_IS_ACTIVE || X_BUDDYPRESS_IS_ACTIVE && x_get_option( 'x_buddypress_header_menu_enable', '' ) == '' ) {
            if ( ! is_user_logged_in() ) {
              $submenu_items .= '<li class="menu-item menu-item-bbpress-navigation"><a href="' . wp_login_url() . '" class="cf"><i class="x-icon x-icon-sign-in"></i> <span>' . __( 'Log in', '__x__' ) . '</span></a></li>';
            } else {
              $submenu_items .= '<li class="menu-item menu-item-bbpress-navigation"><a href="' . bbp_get_user_profile_url( get_current_user_id() ) . '" class="cf"><i class="x-icon x-icon-cog"></i> <span>' . __( 'Profile', '__x__' ) . '</span></a></li>';
            }
          }
    
          if ( $args->theme_location == 'primary' ) {
            $items .= '<li class="menu-item current-menu-parent menu-item-has-children x-menu-item x-menu-item-bbpress">'
                      . '<a href="' . get_post_type_archive_link( bbp_get_forum_post_type() ) . '" class="x-btn-navbar-bbpress">'
                        . '<span><i class="x-icon x-icon-comment"></i><span class="x-hidden-desktop"> ' . __( 'Forums', '__x__' ) . '</span></span>'
                      . '</a>'
                      . '<ul class="sub-menu">'
                        . $submenu_items
                      . '</ul>'
                    . '</li>';
          }
        }
    
        return $items;
    
      }
      add_filter( 'wp_nav_menu_items', 'x_bbpress_navbar_menu', 9997, 2 );
    endif;

    Hope this helps.