Links in new menu don’t work

You have a script active that prevents normal behaviour of links if they have no target=”_blank” attribute on them. The original site has this attribute on the link to the blog, so that one works. The ‘new’ site doesn’t have it on the menu links, so those links are disabled. To fix this, go to … Read more

Show navigation header menu by post and categery

This code will check to ensure that the theme_location is header. Also, menu is the parameter where the desired WordPress Nav menu is specified. menu_id is the HTML ID that is applied to the <ul> element which forms the menu. Docs on the arguments for wp_nav_menu() can be found here. add_filter( ‘wp_nav_menu_args’, ‘bb_wp_nav_menu_args’ ); function … Read more

Navigate to external link if last page or post in a category

Since it’s not clear exactly what you need it’s hard to give you the best solution. However … You should be able to use get_next_posts_link() in your loop template. Or get_previous_posts_link() if that’s what you want. If that returns null you can then echo a link to whereever you want in your template. if(!get_next_posts_link()) { … Read more

index.php navigation

I think you should use wp_link_pages function, it’s was built for that purpose. $defaults = array( ‘before’ => ‘<p>’ . __( ‘Pages:’ ), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ => ”, ‘next_or_number’ => ‘number’, ‘separator’ => ‘ ‘, ‘nextpagelink’ => __( ‘Next page’ ), ‘previouspagelink’ => __( ‘Previous page’ ), ‘pagelink’ => ‘%’, ‘echo’ … Read more

Can the_post_navigation() be outside of the loop?

Yes, the_post_navigation() works outside of the loop on single post views. Following the function calls, the_post_navigation() uses get_the_post_navigation() which uses get_previous_post_link() and get_next_post_link() which use get_adjacent_post_link() which finally uses get_post() which defaults to the global $post object. Here’s an excerpt of get_adjacent_post_link(): function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $previous = true, $taxonomy = … Read more