wp_nav_menu always falls back to a menu

wp_nav_menu() indeed tries a lot to provide you with a menu, and fallback_cb is only executed when nothing else works. From the code: If menu is provided and refers to an existing menu (looked up via wp_get_nav_menu_object(), which accepts an id, slug or name), this will be the menu Otherwise, if theme_location is set to … Read more

wp_nav_menu not appearing for a couple pages

I had the same problem, but with a newer version of WordPress (3.7.1). On pages with custom taxonomies of custom posts, the wp_nav_menu was not shown. The solution below worked for me. in functions.php of the theme: add_action( ‘pre_get_posts’, ‘my_pre_get_posts’ ); function my_pre_get_posts($query) { if ($query->get(‘post_type’) === ‘nav_menu_item’) { $query->set(‘tax_query’,”); } }

add span class inside wp_nav_menu link anchor tag

Have you tried using the before or link_before parameters in your array arguments when declaring your wp_nav_menu function? Note: use after or link_after for the opposite effect. Example, wp_nav_menu( //normal arguments here….etc ‘before’ => ‘<span class=”arrow”></span>’, //or ‘link_before’ => ‘<span class=”arrow”></span>’, ); From the Codex: $before (string) (optional) Output text before the of the link … Read more

Call custom field into menu item

This is what i have used for checking to see if the custom field is there or not. I am sure you can use it as well. <?php $custom_field = get_post_meta($post->ID, ‘Your Custom Field Name’, true); // Checks to see if there is a value in the custom field if($custom_field != ”) { echo $custom_field; … Read more

Navigate with keyboard in Gallery shortcode

The Underscores (_s) starter theme comes with a keyboard navigation script for this. I haven’t tested this myself though. But the JS file looks like this: jQuery( document ).ready( function( $ ) { $( document ).keydown( function( e ) { var url = false; if ( e.which == 37 ) { // Left arrow key … Read more

Export navigation menu

WordPress has an Import/Export tool, but it doesn’t works with nav menus only, the “All Content” option will export the menus too, but with everything else that is in your site (including posts/pages in the trash) you can try this plugin so the Menu option shows in the Export page.

Remember the last post I read

I like this question so had a look at it myself. The best way I could think to go about it would be to use localstorage and jQuery to store the current URL and scroll position of the user. Then you could either run a check when they come back to that page or have … Read more

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