Home Custom Menu Link not Working

First, I’ll assume that you have custom nav menus properly configured: register_nav_menus() in functions.php, to define theme_location values wp_nav_menu() calls in the template, with theme_location called in the args array Custom nav menus defined in the admin Custom nav menu(s) assigned to Theme Locations If that’s the case, then the issue is that you’re using … Read more

Menu link to all posts (all categories included)

If your blog is setted to show last posts on home page, the link you need is just the home page link, that can be inserted using custom link. If your blog is setted to display a static page as front page, also create a page and set it as “Posts page”, then the link … Read more

How to include the parent page link in this wp_nav_menu walker

WordPress does not have the class Related_Sub_Items_Walker. It looks like you’re using the plugin Advanced Menu Widget. Judging by the widget’s source, you want to use 0 for the start_depth to include the parent. This is untested. <nav id=”sub-navigation”> <?php wp_nav_menu( array( ‘theme_location’ => ‘main-navigation’, ‘container’ => ”, ‘walker’ => new Related_Sub_Items_Walker(), ‘start_depth’ => 0, … Read more

Using website header, menu and footer on WordPress blog

Include wp-load.php in the non-wordpress site to get WordPress functions. define( ‘WP_USE_THEMES’, false ); require( ‘/path/to/wp-load.php’ ); Then you should be able to make the appropriate calls to get_header(), get_footer(), and wp_nav_menu() as you would within your WordPress theme.

Can’t include Language switch in Nav Menu

You have to return the data in the qtrans function: function qtrans_generateLanguageListCode($id=”) { global $q_config; if (is_404()) $url = get_option(‘home’); else $url=””; if (” === $id) $id = ‘qtranslate’; $id .= ‘-chooser’; $output=””; foreach (qtrans_getSortedLanguages() as $language) { $classes = array(‘lang-‘.$language); if($language == $q_config[‘language’]) $classes[] = ‘active’; $output .= ‘<li class=”‘. implode(‘ ‘, $classes) .'”><a … Read more

Custom walker nav – Add sequential number as class

Try it like this: class ik_walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $GLOBALS[‘ik_walker_counter’] = 0; $output .= ‘<nav class=”site-navigation” role=”navigation”>’. ‘<ul>’; } function end_lvl(&$output, $depth) { $output .= ‘</ul>’. ‘<button id=”menu” class=”menu-button” type=”button” role=”button” aria-label=”Menu Toggle”>’. ‘<span class=”icon-menu”></span>’. ‘</button>’. ‘</div>’; } function start_el(&$output, $item, $depth, $args) { global $wp_query; global $ik_walker_counter; $indent = ( … Read more

Use menu class in walker function

Joining all class names: Please try: $item_output .= sprintf( ‘<span class=”%s”></span>’, join( ‘ ‘, $item->classes ) ); instead of $item_output .= ‘<span class=”‘. $item->classes .'”></span>’; to join the array elements of $item->classes into a string. If you add for example aaa bbb ccc to an item’s class text field, it will show up like this: … Read more