• Hi All

    I obtained this code from wpsites.net which added the Next/Previous Post links.

    add_action( 'genesis_entry_content', 'custom_single_post_nav', 12 );
    function custom_single_post_nav() {
    
    	if ( ! is_singular( 'post' ) )
    		return;
    
    	echo '<div class="pagination-previous alignleft">';
    	previous_post_link('%link', 'Previous Post', FALSE);
    	echo '</div>';
    
    	echo '<div class="pagination-next alignright">';
    	next_post_link('%link', 'Next Post', FALSE);
    	echo '</div>';
    
    }

    Is there a function I can add that will display the link for the next or previous post in the same category please?

    Thanks

    Rich

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter Richard Brown

    (@cregy)

    Found the code

    add_action( 'genesis_entry_content', 'custom_single_post_nav', 12 );
    function custom_single_post_nav() {
    
    	if ( ! is_singular( 'post' ) )
    		return;
    
    	echo '<div class="pagination-previous alignleft">';
    	previous_post_link('%link', 'Previous Post', FALSE);
    	echo '</div>';
    
    	echo '<div class="pagination-next alignright">';
    	next_post_link('%link', 'Next Post', FALSE);
    	echo '</div>';
    
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Next Previous post links for current category only’ is closed to new replies.