So I have very little php experience, and I would like to have posts that are in a similar category to be shown when clicking on the "<< Next Post" or "Prev Post >>" links.

I looked up how and found the function for next_post_link() and it's parameters. So I went through my publichtml/wp-includes/link-template.php file and changed the variable $in_same_tax from false to true.

I also went ahead and changed all the instances (14 of them) where $in_same_tax was set to false and changed them all too true as well.

I uploaded the new file via cpanel, and reloaded the page to test if this worked. It didn't.

I looked at other similar questions like this one. But all the suggestions that I saw either didn't work or didn't seem to apply to my issue.

I'm using a Astra as the theme if that matters.

Any help would be appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.