show previous/next post orderer by title in custom post types

If you use a filter like the following to adjust the order of a post type archive, then the next & previous links will work perfectly without need for modification: function wpse_139866_set_order_by( $wp_query ) { if ( ! is_admin() && $wp_query->is_post_type_archive( ‘my_post_type’ ) && $wp_query->is_main_query() ) { $wp_query->set( ‘orderby’, ‘title’ ); } } add_action( ‘pre_get_posts’, … Read more

Next page link via the custom menu

It turns out i solved the problem by renaming my Staff template from archive-staff.php to page-staff.php (or anything else for that matter), thus specifically telling WordPress not to trust the template hierarchy logic and to consider that url as a “page” url, not a custom post type archive. If you happen to have a use … Read more

Next post in category

You should be able to just use the default get_next_post_link with $in_same_term set to true. Have you tried that? Instead of your <?php next_post_link( ‘<div class=”nav-next”>%link</div>’, ‘%title <span class=”meta-nav”>’ . _x( ‘&rarr;’, ‘Next post link’, ‘sixteen’ ) . ‘</span>’ ); ?> try this <?php next_post_link ( ‘%link &rarr;’, ‘%title’, true, ”, ‘category’ ); ?>

Next and Prev post link breaks code on last post

This should work. Wasn’t closed well <div id=”cooler-nav” class=”navigation”> <div class=”wpb_wrapper”> <h3>More Underwater Media</h3> </div> <?php $prevPost = get_previous_post(true); if($prevPost) {?> <div class=”nav-box previous”> <div class=”navig_thumb_wrapper”> <?php $prevthumbnail = get_the_post_thumbnail($prevPost->ID, array(100,100) );?> <?php previous_post_link(‘%link’,”$prevthumbnail”, TRUE); ?> </div> <?php previous_post_link(‘%link’,”<p>< %title</p>”, TRUE); ?> </div> <?php } ?> <?php $nextPost = get_next_post(true); if($nextPost) {?> <div class=”nav-box next” … Read more