Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #2818114
Previous Post and Next Post in Single Post
Closed

Comments

  • calvinteoh started the conversation

    Inside a "Single Post", the "previous post and next post" is not showing posts of the same category. Is there a way to change the setting, so that the posts shown are of the same category instead? On top of that, is there a way to remove the previous and next post? 

    9009155474.jpg
  •  2,615
    PenciDesign replied

    Hi,

    1.Please go to Appearance → Theme Editor, navigate to this file:

    inc/templates/post_pagination.php

    Find:

    $prev_post = get_previous_post();
    $next_post = get_next_post();
    Replace to:

    $prev_post = get_previous_post( true );
    $next_post = get_next_post( true );
    image.png

    2. In case you want to disable this feature, please go to Appearance → Customize → Single Post → General, check the Hide Next/Prev Post Navigation option.

    Regards,
    PenciDesign.

  • calvinteoh replied

    Thanks for the fast feedback! As you have recommended, I have edited:

    inc/templates/post_pagination.php

    The outcome is now showing post of the same category. 

    However, the previous and next post doesn't seems to be based on publication date. So if I clicked at the 1st post, I would expect the next post is the 2nd post. Similarly, 2nd post, the next post is the 3rd post while the previous post is 1st post. 

    Can you explain how does the previous and next post arranged?  



  •  2,615
    PenciDesign replied

    Hi,

    The previous/next post is auto arrange and sort by WordPress. You can read the function detail here: https://developer.wordpress.org/reference/functions/get_previous_post/

    Regards,
    PenciDesign.


  • calvinteoh replied

    Got it, thanks for the fast response! I would check it out and use the information to update my posts so that it will appear as expected. Thanks.