Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1129322

    stephrodney
    Participant

    Hi X theme allows the option to add premade bbpress and buddypress navigation buttons, a person and a chat box, below those, Is it possible to add other pages to this menu? Or to edit these pages? By taking some away and putting new ones in its place?

    #1129682

    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.

    Thank you.

    #1129836

    stephrodney
    Participant

    I have attached a screen shot of the navigation icons. When you click them it gives you an option to select more from a drop down menu. Is there anyway to edit this?

    #1130206

    Rad
    Moderator

    Hi there,

    What editing do you wish to apply? These are the code responsible for that

    function x_buddypress_navbar_menu( $items, $args ) {
    
        if ( X_BUDDYPRESS_IS_ACTIVE && x_get_option( 'x_buddypress_header_menu_enable' ) == '1' ) {
    
          if ( bp_is_active( 'activity' ) ) {
            $logged_out_link = bp_get_activity_directory_permalink();
          } else if ( bp_is_active( 'groups' ) ) {
            $logged_out_link = bp_get_groups_directory_permalink();
          } else {
            $logged_out_link = bp_get_members_directory_permalink();
          }
    
          $top_level_link = ( is_user_logged_in() ) ? bp_loggedin_user_domain() : $logged_out_link;
          $submenu_items  = '';
    
          if ( bp_is_active( 'activity' ) ) {
            $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_activity_directory_permalink() . '" class="cf"><i class="x-icon-thumbs-up" data-x-icon="" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_activity_title' ) . '</span></a></li>';
          }
    
          if ( bp_is_active( 'groups' ) ) {
            $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_groups_directory_permalink() . '" class="cf"><i class="x-icon-sitemap" data-x-icon="" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_groups_title' ) . '</span></a></li>';
          }
    
          if ( is_multisite() && bp_is_active( 'blogs' ) ) {
            $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_blogs_directory_permalink() . '" class="cf"><i class="x-icon-file" data-x-icon="" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_blogs_title' ) . '</span></a></li>';
          }
    
          $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_members_directory_permalink() . '" class="cf"><i class="x-icon-male" data-x-icon="" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_members_title' ) . '</span></a></li>';
    
          if ( ! is_user_logged_in() ) {
            if ( bp_get_signup_allowed() ) {
              $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_signup_page() . '" class="cf"><i class="x-icon-pencil" data-x-icon="" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_register_title' ) . '</span></a></li>';
              $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_get_activation_page() . '" class="cf"><i class="x-icon-key" data-x-icon="" aria-hidden="true"></i> <span>' . x_get_option( 'x_buddypress_activate_title' ) . '</span></a></li>';
            }
            $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . wp_login_url() . '" class="cf"><i class="x-icon-sign-in" data-x-icon="" aria-hidden="true"></i> <span>' . __( 'Log in', '__x__' ) . '</span></a></li>';
          } else {
            $submenu_items .= '<li class="menu-item menu-item-buddypress-navigation"><a href="' . bp_loggedin_user_domain() . '" class="cf"><i class="x-icon-cog" data-x-icon="" aria-hidden="true"></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-buddypress">'
                      . '<a href="' . $top_level_link . '" class="x-btn-navbar-buddypress">'
                        . '<span><i class="x-icon-user" data-x-icon="" aria-hidden="true"></i><span class="x-hidden-desktop"> ' . __( 'Social', '__x__' ) . '</span></span>'
                      . '</a>'
                      . '<ul class="sub-menu">'
                        . $submenu_items
                      . '</ul>'
                    . '</li>';
          }
        }
    
        return $items;
    
      }
      add_filter( 'wp_nav_menu_items', 'x_buddypress_navbar_menu', 9997, 2 );

    and

    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-search" data-x-icon="" aria-hidden="true"></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-star" data-x-icon="" aria-hidden="true"></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-bookmark" data-x-icon="" aria-hidden="true"></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-sign-in" data-x-icon="" aria-hidden="true"></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-cog" data-x-icon="" aria-hidden="true"></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-comment" data-x-icon="" aria-hidden="true"></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', 9996, 2 );

    You can add these to your child theme’s functions.php with the changes you wish to apply.

    Thanks!

    #1130872

    stephrodney
    Participant

    Great thank you! I would mostly like to change the chat box to say forum, or to add a forum tab underneath it.

    #1130898

    Rupok
    Member

    Hi there,

    Thanks for updating. Please provide your URL so that we can provide you some tailored code for this.

    Cheers!

    #1130908

    stephrodney
    Participant
    #1130912

    Rupok
    Member

    Hi there,

    Thanks for writing back! It seems your website is under construction. Please take it off or provide us the credentials in private reply so that we can check and assist you on this.

    Thanks

    #1130986

    stephrodney
    Participant
    This reply has been marked as private.
    #1131274

    Rue Nel
    Moderator

    Hello There,

    To add a forum text in the chat bubble, please insert this following code in your child theme’s functions.php file.

    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-search" data-x-icon="" aria-hidden="true"></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-star" data-x-icon="" aria-hidden="true"></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-bookmark" data-x-icon="" aria-hidden="true"></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-sign-in" data-x-icon="" aria-hidden="true"></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-cog" data-x-icon="" aria-hidden="true"></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-comment" data-x-icon="" aria-hidden="true"></i> ' . __( 'Forums', '__x__' ) . '</span>'
                    . '</a>'
                    . '<ul class="sub-menu">'
                      . $submenu_items
                    . '</ul>'
                  . '</li>';
        }
      }
    
      return $items;
    
    }
    add_filter( 'wp_nav_menu_items', 'x_bbpress_navbar_menu', 9996, 2 );

    You can copy the raw code here (http://pastebin.com/gA0T6LsQ) to preserve the unicode html entities or data-x-icon values. Feel free to add more links to that code if you want to.

    Hope this helps. Please let us know how it goes.

    #1131836

    stephrodney
    Participant

    Thank you! It worked perfectly!! 😀 Much appreciated

    #1131881

    Thai
    Moderator

    Glad it worked 😉

    If you need anything else please let us know.

    #1150661

    stephrodney
    Participant

    Hi In regards to the above can I please have the code to change the navigation icon with the person to say members? thank you

    #1150800

    Rad
    Moderator

    Hi there,

    From the code above, you’ll see something like this

    <i class="x-icon-male" data-x-icon="" aria-hidden="true"></i>

    It’s the data-x-icon="" that dictates which icon is to load. You can find all icon codes here http://fontawesome.io/cheatsheet/

    Hence, if you wish to change the icon then just change its value, example,

    <i class="x-icon-male" data-x-icon="&#xf004;" aria-hidden="true"></i>

    Hope this helps.

    #1150906

    stephrodney
    Participant

    I do not understand? Can you please just tell me the whole thing together? Or are you saying to add that to the code I already have?