wp_nav_menu, add class to every nth item?
You can use jQuery to do that. Try this in your header : $(document).ready(function() { $(“#mymenu li:nth-child(3n+3)”).addClass(“last”); }); Note : for this to work you need to have enqueued jQuery.
You can use jQuery to do that. Try this in your header : $(document).ready(function() { $(“#mymenu li:nth-child(3n+3)”).addClass(“last”); }); Note : for this to work you need to have enqueued jQuery.
That’s an old question, if someone like me landed on this page for WORDPRESS MULTISITE MENU sharing across all network sites without any plugin, Not only menu you can use the same method to share anything other then widgets across all the network sites. here is the solution : Edit your Header.php //store the current … Read more
There’s a filter called wp_list_pages_exclude that you could possibly hook into (put this in your functions.php): function filter_wp_list_pages($exclude){ $exclude[] = 56; return $exclude; } add_filter(“wp_list_pages_excludes”, “filter_wp_list_pages”);
For a copy paste solution check this custom Walker out: http://goodandorgreat.wordpress.com/2012/01/12/update-2-using-twitter-bootstrap-dropdown-menus-with-wordpress/ It’s missing one or two things like data-toggle=”dropdown” and <b class=”caret”></b>. It should be quite easy to figure that out, but here’s my modified version: https://gist.github.com/1817371 Hope that helps.
Put <?php if( !is_404() ) : ?> before your navigation and <?php endif; ?> after your navigation and VIOLA! It’s gone!
idk about working it back into your breadcrumbs… which by nature i think are hierarchical. but this should give you a list of the pages that have the same parent as the page you are on (aka its siblings) albeit in a totally unstyled way global $post; $args = array(‘child_of’ => $post->post_parent, ‘exclude’=> $post->ID); if … Read more
This usually happens when you are trying to do admin navigation stuff and you aren’t hooked into admin_menu. If you hook in before that, $menu hasn’t been created yet. add_action(‘admin_menu’, ‘my_plugin_add_menu’); function my_plugin_add_menu(){ $ptype=”my_post_type”; $ptype_obj = get_post_type_object( $ptype ); add_submenu_page( ‘my-menu-item’, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, “edit.php?post_type=$ptype” ); }
I sort of added onto @Giri’s answer by using array_map and array_count_values. if this helps anyone in the future. I didn’t wish to use a counter and a foreach loop for something so simple. function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { if ($item->hasChildren) { $locations = get_nav_menu_locations(); … Read more
Finally the answer is simple: $menu_name=”your menu”;//name,id,slug wp_delete_nav_menu($menu_name);
// set up the arguements for post type $labels = array(….); $args = array( ‘labels’ => $labels, ‘public’ => true, // display on menu and site ‘publicly_queryable’ => false, ‘show_ui’ => true, ‘query_var’ => false, ‘rewrite’ => false, ‘capability_type’ => ‘post’, ‘hierarchical’ => false, ‘menu_position’ => 111, ‘supports’ => array( ‘title’ ) ); // register … Read more