• Hi All!

    New to the forums so I apologise if this is in the wrong place!

    I was wondering if it was possible, without any super advanced knowledge of .php to hack the ‘category’ element of the previous_post_link and next_post_link so that it looks at two categories that the current page sits in and links to the articles that ONLY contain those two categories.

    Really struggling with this one – I’ve tried adding multiple categories here

    <?php previous_post_link(‘%link’, ‘Next’, TRUE, ‘Article, Motion’); ?> (my categories are “Article” “Motion” “Personal” and “Filter” I’ve managed to differentiate between “Article” and “Filter” but now I need them to differentiate between the two “PERSONAL” and “MOTION” categories as well. I’m literally going mad as I can’t figure it out

    Hope this makes sense, and it’s a straight forward resolve!

    All the best

    Tim

Viewing 2 replies - 1 through 2 (of 2 total)
  • This might have some useful information to help you – there are a few code examples to work with:

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

    This plugin hasn’t been updated for a few months and i have never personally used it, so not sure if it would work – but this might get you pointed in the right direction also, either by trying it on your site or by downloading and reviewing the code:

    https://wordpress.org/plugins/smarter-navigation/

    Thread Starter timb0jones

    (@timb0jones)

    Hi mchelles

    Thanks for the reply, and the help but…

    I’ve tried both of those options and they’re not working for me unfortunately

    I basically need the links to look at BOTH categories e.g MOTION and ARTICLE and go to the next MOTION ARTICLE (also previous) but instead it’s pulling in all the posts with the tag ARTICLE too, which is where I’m getting lost and confused

    Best

    Tim

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multi category previous and next links’ is closed to new replies.