I want to add a code in my theme to show a Next/Previous link below the post but within the same category. I Don’t need a thumbnail but if possible I would appreciated, still that’s not important right now. Right now I just want to insert a code(s) to one of my PHP scripts so that it would show a next/previous link in the post.
I search on google and find some stuff But I don’t know how to use them.
For example, I don’t know how’s the next_posts_link or previous_posts_link works. Because my theme don’t have the LOOP.
I use many plugins but soe doesn’t work for me and the one that work doesn’t show on Mobile version. Right now the one that work for me is the WP Single Post Navigation Within Category Plugin.
My website is a Movie Episode site so I want to be able to let visitors to click next to the next episode within the same Series/Category.
If there’s anything you can help please, Help.
1 Answer
There are the core functions next/previous_post_link()
that accept several arguments. The 3rd is the one that triggers in_same_cat
. So if you set that one to TRUE
, then you’ll only get posts that are in filed under the same category.