Avada Forums Community Forum Blog Next Previous in Same Category

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • exceedion
    Participant
    Post count: 2

    Need a way for the next / previous links on the single post page to return posts in the same category. Can anyone help?

    exceedion
    Participant
    Post count: 2

    Here is the solution we used.

    Edit the single.php file.

    <?php previous_post_link( ‘%link’, ‘Previous post in category’, TRUE ); ?>
    <?php next_post_link( ‘%link’, ‘Next post in category’, TRUE ); ?>

    https://codex.wordpress.org/Function_Reference/next_post_link

    carolinenye
    Participant
    Post count: 2

    Hi exceedion, thanks for posting this solution – I have a similar problem, tried implementing your code however it breaks all my single post pages so reverted back. Is this still working for you? Does anyone know of another way to force previous/next navigation by category or tag?

    coolartwork
    Participant
    Post count: 2

    use this, but validate in html editor the (‘) signs

    <?php previous_post_link( '%link', esc_attr__( 'Previous', 'Avada' ), TRUE ); ?>
    <?php next_post_link( '%link', esc_attr__( 'Next', 'Avada' ), TRUE ); ?>

    it works for me

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.