Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1319956
    Pbalazs89
    Participant

    Hi there,

    I’m currently building a site at:

    http://biokutatas.decorolux.com/

    I would like to add an extra ‘li’ item named ‘en’ after the search bar in the top to switch between languages.

    Is there a way to do so?

    Thanks!

    #1320012
    Christopher
    Moderator

    Hi there,

    It depends on your plugin. Which language switcher plugin you use? If you’re using WPML, check this link https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/

    Hope it helps.

    #1322151
    Pbalazs89
    Participant

    That I did, end I set it so that the language switcher is the last element in the navbar. So far so good, but if I turn on the search bar, it will place it after the language switcher. Is it possible to have them switch places?

    Thanks!

    #1322188
    Paul R
    Moderator

    Hi,

    You can try adding this in your child theme’s functions.php file

    
    function x_navbar_search_navigation_item( $items, $args ) {
    
        if ( x_get_option( 'x_header_search_enable' ) == '1' ) {
          if ( $args->theme_location == 'primary' ) {
            $items .= '<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 $items;
    
      }
      add_filter( 'wp_nav_menu_items', 'x_navbar_search_navigation_item', 0, 2 );
    

    Change 0 to adjust priority/order

    Hope that helps.

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