Forcibly show previous/next links

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

WordPress get_pages meta_key don’t show page

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

Adding direct link to post editor in admin menu

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.

Walker_Nav_Menu Add Strings and Class Name

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

How to remove anchor of current menu item in navbar?

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