Exclude a category from next_previous articles

Posted in: Newspaper
Post count: 37

Hi, I want to exclude a certain category ID from the next_previous articles that appear at the bottom of a single post page.

I’m clear with what I need to do in ‘ordinary’ php code. But the tagdiv code seems to break this down further. I’ve looked at td_module_single_base.php but there isn’t an obvious place to add a new parameter.

Is there somewhere else that I should be looking?

Donald

Post count: 22421

Hi,

You can exclude a category using the following method:
Our theme uses a default wp function for the next and prev buttons:
https://codex.wordpress.org/Function_Reference/get_next_post and https://codex.wordpress.org/Function_Reference/get_previous_post
Both of these functions can have an exclude paramter as the codex suggest so you can simply add the category ID you want to exclude like so: http://screencast.com/t/re2JlNCmSo

I hope this helps.
Thanks

Post count: 37

Hi, Bogdan, thank you so much, I’ll get this implemented first thing I do.

Cheers,
Donald

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