Where to find the topmenu?

  • Author
    Posts
  • #28190
    Yvonne

    Hello!
    I’m wondering where to find the topmenu? It’s not in the header.php…at least i don’t see it.
    I found it in the css though and already managed to make the topbar smaller. I want to place language flags at the ed of the topmenu, so i need t know in which .php-file it is in.
    Can anybody help?

    Thanks a lot!

    #28257
    Kay
    Cryout Creations mastermind

    Hi,

    The menus are created using WordPress hooks and functions and you can find that in /includes/theme-setup.php

    Too add to that it you should use filters. Here’s and example of how to add a searchbar to it:

    add_filter(‘wp_nav_menu_items’,’add_search_box_to_menu’, 10, 2);

    function add_search_box_to_menu( $items, $args ) { 
        if( $args->theme_location == 'top' ) {
            $items = $items."<li class='menu-header-search'>
    	    <i class='search-icon'></i>
    	    <form action='".esc_url(home_url( '/' ))."' id='searchform' method='get'>
    	        <input type='text' name='s' id='s' placeholder='".__('Search','nirvana')."...'>
    	        <input type='submit' id='searchsubmit' value='&#xe816;' />
    	    </form>
    	</li>";
        }
    return $items;
    }

    No matter how you do it though, always remember to use child themes. http://www.cryoutcreations.eu/wordpress-themes/wordpress-tutorials/wordpress-child-themes

    Good luck!

    • This reply was modified 10 years ago by Kay.

    Before posting consider reading our short theme debugging instructions.
    Please read the FAQs: MantraNirvanaParabolaTempera
    Tutorials: custom menustranslating themeinstalling themecategory page with introdisabling comments Wordpress: child themescategories/posts
    Before making any modifications to your theme we strongly recommend using Child Themes.
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Where to find the topmenu?’ is closed to new replies.