Next / previous article limit to category?

Posted in: Newspaper
Post count: 88

Hi there. I thought I was almost done with my website but today I noticed that the next/previous article made no sense to me. Then it hit me: the function does not look at the category, only on the published date. I really need that function for my website to make sense; I have split complex topics across multiple articles.

Is there a setting somewhere to adjust it’s behavior. If not can someone propose where (and possibly how, I am not that pro 😛 ) to place a php mod? I guess it should not be very different from stuff that the theme already uses to show posts of a specific category.

thanks in advance

Sebastiaan.

ps example: http://goo.gl/WdlEhH

  • This topic was modified 10 years by Magistar.
Post count: 22421

Hello,
Unfortunately there is no option for this in the theme, but you can make the next and prev posts display from the same category. You just need to type true within the parenthesis here: http://screencast.com/t/iXIGXXJVHEU
so the code should look like this:
$next_post = get_next_post(true);
$prev_post = get_previous_post(true);

This will make the next and prev posts dependent on the post category. If a post has multiple categories it will jump to other categories though.
I hope this helps.
Thank you!

Post count: 88

Hi Bogdan B,

That has completely solved my issue :)! I am glad you could show me how to modify this.

Have a nice day.

Sebastiaan.

Post count: 44

I would like to display the screenshot attached, How to include a NEXT <> PREVIOUS with graphic file http://prnt.sc/cd5wv1

thx

Post count: 6535

Hi

To change theme’s pagination you will need some customizations in code. This is a very complex task which involve many changes and tests in order to be achieved. For the moment we can’t offer custom services so if you really need this my advice is to look for someone who can help you with implementation or hire a developer to do it for you.

Thanks for your understanding.

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.