Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1128056
    Tobi Agli
    Participant

    Hi!
    You guys rock!
    I would like to change the menu order for the search icon to first on the menu. Right now it’s last.
    How can I do that?

    PS: My Cornerstone, X Theme, and plugins are all up to date as per today 🙂

    Thank you!

    #1128342
    Friech
    Moderator

    Hi There,

    Thanks for writing in! 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.

    Then add this on your child theme’s function.php file.

    
    // Navbar Search Navigation Item
    // =============================================================================
    
    if ( ! function_exists( 'x_navbar_search_navigation_item' ) ) :
      function x_navbar_search_navigation_item( $items, $args ) {
    
        if ( x_get_option( 'x_header_search_enable' ) == '1' ) {
          if ( $args->theme_location == 'primary' ) {
             $xsearch = '<li class="menu-item x-menu-item x-menu-item-search">'
                      . '<a href="#" class="x-btn-navbar-search">'
                        . '<span><i class="x-icon-search" data-x-icon="" aria-hidden="true"></i><span class="x-hidden-desktop"> ' . __( 'Search', '__x__' ) . '</span></span>'
                      . '</a>'
                    . '</li>';
          }
        }
    
        return $xsearch.$items;
    
      }
      add_filter( 'wp_nav_menu_items', 'x_navbar_search_navigation_item', 9998, 2 );
    endif;

    Hope it helps, Cheers!

  • <script> jQuery(function($){ $("#no-reply-1128056 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>