wp_nav_menu() showing list in a different Position?

It’s not working for two reasons. You have echo set to false. This means it won’t output anything unless you echo it manually. The resulting HTML structure is invalid. You have items_wrap set it %3$s. This means that the individual menu items, which are <li> tags, will be output without a wrapper. That would make … Read more

Create wordpress header with custom logo in between the menu splitting the menu into two equal parts [closed]

After some testing I found the best way is to use a walker. For this example lets say that this is the code that calls our menu wp_nav_menu([ ‘container’ => false, ‘theme_location’ => ‘right-side-top-menu’, ‘walker’ => new Menu_Middle_Logo() ]); Now for our walker, there isn’t an easy way to determine which of the parent menu … Read more

How to generate a list of child pages, and use some of their custom fields?

You could use get_pages to do this, like so: <?php $args = array( ‘post_type’ => ‘page’, ‘child_of’ => 7, ); $postobj = get_pages($args); foreach($postobj as $item){ $dir = get_bloginfo(‘template_directory’); // Theme directory $title = $item->post_title; $parent = $item->post_parent; $id = $item->guid; $name = $item->post_name; Once you get to here, you can pull out your custom … Read more

Menu API not switching menus?

_Menus are somewhat confusing around there. Try this: $args = array( ‘theme_location’ => ‘main-navigation’, ‘container_id’ => ‘navigation’, ‘fallback_cb’ => ‘wp_page_menu’ ); wp_nav_menu($args); theme_location tries to display menu that is attached to this location. menu tries to display menu by slug/id (not location of menu, but actual menu that you create in admin area). So you … Read more

Image as a link using wp_nav_menu()

Use CSS to add an image instead of text see: http://wpweaver.info/menu-bar-and-background-images/ http://en.forums.wordpress.com/topic/cutline-gt-coraline-replacing-menu-items-with-graphics http://wpveda.com/how-to-add-images-inside-wordpress-3-0-custom-menu/

add JS to multiple plugin admin pages

It would be easiest to run some conditional logic on $parent_file inside a callback hooked onto admin_print_scripts, and would go a little something like this.. add_action( ‘admin_print_scripts’, ‘possibly_enqueue_script’ ); function possibly_enqueue_script() { global $parent_file; if( ‘my-slug’ == $parent_file ) wp_enqueue_script( … your enqueue args .. ); } You’ll need to replace my-slug with the handle … Read more