Help With 'Related Posts' Plugin
I actually see two plugins with this name. The first, by Denis, would require you to add this code to your templates:
<?php wp_related_posts(); ?>in your templates
which could be achieved using action hooks, I image.
The second, by Thamizhchelvan, does not require this. It adds a “Related Posts” option to each post, which you would have to fill in by hand.
I tried using the first plugin (by Denis), adding this code to my child theme’s functions.php file:
It works! You can see it in action here.
If you do this, be sure to include the opening (
<?php) and closing (
?>) PHP tags in your functions.php file. (I forgot to do this.)
I added this just after the content, using the Graphene
graphene_after_post_contentaction hook. You can add it someplace else by using a different action hook. The complete list of Graphene action hooks is here.
As it turns out, this causes the related posts listing to show up on the front page, even if you’re just showing excerpts on the front page. (?)
But in the Related Posts settings, there is an option called “Auto Insert Related Posts? ” Ticking that box makes them show up automatically where I had placed them using an action hook, but they don’t show up in the excepts on the front page, which is easier.
You can still use the action hook method if you want them to show up someplace else, however.
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.