Custom theme navigation

1. Register your menu Register your menu with register_nav_menus() after which you can choose that menu from admin area: Appearance -> Menus. Add one of these to functions.php: <?php register_nav_menus( array( ‘primary’ => __( ‘Main Menu’, ‘tt’ ) ) ); //’primary’ is basically like a slug that can be used to get that specific menu … Read more

add span class and i tag inside wp_nav_menu link anchor tag

You can use the wp_nav_menu() arguments like so: wp_nav_menu( array( ‘menu’ => ‘Whatever Your Menu Name Is’, ‘link_before’ => ‘<span class=”main-nav__item-icon-wrapper”><i class=”main-nav__item-icon icon-home”></i></span><span class=”main-nav__item-content”>’, ‘link_after’ => ‘</span>’ ) ); link_before and *_after will add anything before/after the text inside the link where just the normal argument before and after will add anything before/after the entire … Read more

wp_nav_menu() with multiple Class

I don’t know what your conditions are for each class by the hook you’re looking for is nav_menu_css_class. You can use it to append classes or remove classes from each list-item <li> in the menu. /** * Modify list item classes of wp_nav_menu * – https://codex.wordpress.org/Plugin_API/Filter_Reference/nav_menu_css_class * – https://developer.wordpress.org/reference/hooks/nav_menu_css_class/ * * @param Array $classes || … Read more

Multiple WordPress Menus that will only display all pages

The keys for the array passed to register_nav_menus() should correspond with the ‘theme_location’ arguments in your calls to wp_nav_menu(). Since they do not, WordPress is unable to locate the appropriate menu and displays a default consisting of all top-level pages instead. Either change your ‘theme_location’ arguments to ‘menu-1’ and ‘menu-2’ or change the array keys … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)