Using query_posts inside single.php loop
You need to call wp_reset_postdata() after your query to restore the global $post variable that the navigation link functions use to determine the next/previous posts.
You need to call wp_reset_postdata() after your query to restore the global $post variable that the navigation link functions use to determine the next/previous posts.
Exclude Post Format from next_post and prev_post
Twenty Eleven theme- have custom landing page, change nav “home” link
This is one of the code i have used in the past. The below code goes in your functions.php class MP_Footer_Menu extends Walker_Nav_Menu { function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { STATIC $counter = 0; if ($counter++) $output .= ‘<li class=”divider”>/</li>’; parent::start_el($output, $item, $depth, $args, $id); } } This … Read more
I had the exact same problem a while ago on one of my themes. My problem was that the theme used query_post to filter out some posts. This caused the pagination to fail. I think this was the code that solved it: <?php if ( is_home() ) { $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; … Read more
Ideally, you should be passing the “theme_location” argument to wp_nav_menu(). Register your three menus in functions.php: register_nav_menus( array( ‘front_page’ => ‘Front Page Menu’, ‘single’ => ‘Single Post Menu’, ‘default’ => ‘Default Menu’ ) ); Then, replace your code above with: if ( is_front_page() ) { wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘front_page’ )); } … Read more
Create a custom menu item in the admin panel with a dummy URL, foo.com or whatever. Add it to the menu, then delete the target URL and save. The menu item will be rendered without an href attribute and will be unclickable.
It is possible. Two options: If the subpages are just children of the currently displayed page, you call: wp_list_pages( array ( ‘child_of’ => $GLOBALS[‘post’]->ID ) ); See Codex documentation. Very simple. If you need a custom structure, for example a list of custom taxonomies when a special post type is viewed, you need to create … Read more
WP nav menus don’t allow you to paste in HTML directly. Option 1 Instead, you could create a “Cart” menu item, and use CSS to move the text off the visible page (so screen readers still read it, but sighted visitors don’t see it) and add the icon with an :after. (You can add a … Read more
This is one of those question where solid answer is not an easy one to follow. This function is powered by Walker_Page class and you can replace it with your own walker (extended from Walker_Page or just Walker) by passing its name in walker argument to wp_list_pages(). In a nutshell it is very highly flexible … Read more