Adding nav menu name from plugin options dynamically
Adding nav menu name from plugin options dynamically
Adding nav menu name from plugin options dynamically
Better way is put: wp_nav_menu( array(‘menu’ => ‘Top menu’,’menu_class’ => ‘top_menu’)); And then force your html classes to wordpress, or simply 5 min rewrite css rules, classies names for wordpress. WordPress uses ul li ul li ul li, and so on structure, and there is no problem to fix it.
How to add navigation in footer like StackExchange?
What I did was the following: Look in index.php for the name of the function that creates the older/newer posts links. Search (using the multifile search function of my text editor) for where that function is defined. Open that file and copy the HTML code from there to index.php, replacing the function call. Save index.php … Read more
Add default wp_nav_menu classes to my custom links
Add following CSS code in style.css file of your theme. @media only screen and (max-width: 760px){ .menu-toggle { display: none; } }
For the reasons I probably don’t want to hear about, curiously get_pages() does not actually uses WP_Query internally. Like every other way to retrieve posts does. From a quick look a source it always treats meta_value as string, which I would guess is the reason for you not getting expected behavior. I would suggest to … Read more
When you are adding the menu slug as edit.php?post=706&action=edit, it is adding in the url after admin.php considering it as a new page in admin dashboard (general behaviour of add_menu_page()) So, you should give a fully qualified url instead. I think, admin_url() should help. Try adding admin_url(‘post.php?post=706&action=edit’) Or admin_url(‘edit.php?post=706&action=edit’) instead of edit.php?post=706&action=edit as menu slug.
This drove me crazy. Here is the solution, hope someone find it useful or suggest a better and shorter solution: class sstmyp_Walker_Nav_Menu extends Walker_Nav_Menu { function display_element($element, &$children_elements, $max_depth, $depth=0, $args, &$output) { $id_field = $this->db_fields[‘id’]; // add custom class and carets to menu has children if(in_array(“menu-item-has-children”, $element->classes)) { $element->classes[] = ‘dropdown’; $element->title .= ‘ … Read more
Michelle is right. You could create your own walker and override the default method that creates the anchor. Or you can hack it by doing this: jQuery(document).ready(function($) { var current = $(“#nav_menu_id”).find(“.current-menu-item”); $(current).html( $(current).find(“a”).html() ); }); Where “nav_menu_id” is the id of your menu you wish to accomplish this on. Personally, I would invest the … Read more