Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1077998

    Chris
    Participant

    Hello,
    I am a brand new user to xtheme and wordpress.

    I am wondering where navigation bar edits are made, although I’m not even sure if navbar is the right word. Perhaps it’s a widget or menu bar. The terminology is still strange to me.

    At the top of my site I have a menu bar reading:

    Home Advertising Case Studies All Forums [ForumIcon] [personIcon] [searchIcon]

    I have found that going into Appearance > Menus I am able to customize the entries that are words, like “Home”, “Advertising Case Studies”, and “All Forums”

    I have not found where I can edit the “Icon” menus. Indeed, I’m not sure if these little icons are part of the same “Menu” as what is defined in Appearance > Menus, or some other separate part of the page. Specifically there is a Forum Icon shaped like a speech bubble. If I float over it, it provides a dropdown menu that reads “Forums Search”. What is missing is a dropdown menu item reading “All Forums”.

    If a user clicks on the ForumIcon itself, and not the dropdown menu item “Forums Search”, it takes them to the page showing all Forums. However it is not intuitive for a user that the ForumIcon takes users to the All Forums page. There is no popup label or anything that says that’s what it does. So I want to add a dropdown menu item reading “All Forums”. That way I can remove the “All Forums” entry I made in the Appearance > Menus location.

    I hope I’m describing this accurately. I don’t have a child theme nor any css experience so I’m hoping to do this from the web editor. Please let me know if I need to investigate and use a child theme before making this menu change. A concern of mine is when I apply X Theme updates, will I lose my changes or not? It’s not clear to me what I can edit safely and still apply X Theme updates, versus what I should not edit unless the edits are done in a child theme. I realize I have a lot to learn….
    WP 4.9.3.1, XTheme 4.6, bbPress, BuddyPress
    http://www.amillionimpressions.com
    Thanks,
    Chris

    #1078822

    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    You can turn on and off those menu features on your customizer. It can’t be edited through Appearance > Menus, they are integrated by coding. For example, let’s say Buddypress menu item ( \wp-content\themes\x\framework\functions\global\plugins\buddypress.php )

    This is 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 );

    You can copy that code and edit it, then paste it to your child theme’s functions.php

    All integrations are available here \wp-content\themes\x\framework\functions\global\plugins\ and you may just copy and paste to your child theme’s functions.php with the changes you wish to implement.

    Child theme is recommended if you don’t wish the next update ovewrite your customization.

    Hope this helps.