Dear Pagelines team, leafing through the Forums, I found an old solution to a problem I am facing: How to make the PostNav section include posts from the same category only? This is the suggested fix:
I seem to have figured it out, but if this is wrong or if there is another way, let me know.
Here is what I've done in the sections directory for postnav section.php
<span class="previous"><?php previous_post_link('%link', $link='%title', $in_same_cat = true); ?></span>
<span class="next"><?php next_post_link('%link', $link='%title', $in_same_cat = true); ?></span>
I found the postnav section.php (wp-content/themes/dms/dms/sections/navbar). Do I just add the above code? And would it still be valid in DMS2 (it's ancient - from 2012!) I am hesitant as I am always afraid to break things when dealing with PHP. Or is there another way, a plugin or child theme that lets me add this in a safer way (and one that may withstand upgrades)?
Thank you for your help and advice. It is always a pleasure working with Pagelines, every day! I should say that more often, but of course yet again it is only when there is a problem that I get in touch...
Yours faithfully, Jan.