Add custom page link with anchor

I was searching for an answer for this but suddenly I got the idea and it works! In the menu settings just add the anchor link just like an html link code <a href=”#anchor” >titulo </a> So with WP is the same but only adding the anchor in the field link This will create the … Read more

How do I add nested categories to drop-down menu in twenty-eleven?

As a purely theory example, this is how I would approach the problem: $cats = get_categories(); echo ‘<ul>’; foreach($cats as $cat) { echo'<li>’.$cat->name; if($cat->parent != 0) { $subcats = get_category(‘child_of=”.$cat->cat_ID; echo “<ul>’; foreach($subcats as $subcat){ echo ‘<li>’.$subcat->name.'</li>’; } } echo ‘</li>’; } echo ‘</ul>’; I don’t expect that to work fully as I coded it … 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

How can I add (custom) modules to Appearance -> Menus?

When you register a custom post type, set the argument show_in_nav_menus to TRUE, and WordPress will create the box for you automatically. This works for custom taxonomies too. Example, requires PHP 5.4 or newer. add_action( ‘wp_loaded’, function() { $post_type=”foo”; add_action( ‘registered_post_type’, function( $registered ) use ( $post_type ) { if ( $registered !== $post_type ) … Read more

Deleted pages are NOT removed from custom menus?

Empty your trash 🙂 Pages are not removed from the custom menus until they’ve been deleted completely. I’ve tested it right now. Creating a complex nav menu can take a very long time and the pages can be bulk deleted in a sec. I believe WordPress is just trying to save you all the trouble … Read more

Show current navigation path from menu

The best way would be to use wp_nav_menu with a custom walker. Prerequisites: Registered theme location Menu saved to that theme location Useage Wherever you want the breadcrumbs (for theme location ‘primary’): <?php wp_nav_menu( array( ‘container’ => ‘none’, ‘theme_location’ => ‘primary’, ‘walker’=> new SH_BreadCrumbWalker, ‘items_wrap’ => ‘<div id=”breadcrumb-%1$s” class=”%2$s”>%3$s</div>’ ) ); ?> The custom walker … Read more

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