Return to Support

Help With 'Related Posts' Plugin

Home Forums Graphene WordPress theme Support Help With 'Related Posts' Plugin

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1666
    ipoppedoff
    Member

    Hello,

    Is there any suggested ‘Related Post’ WordPress.org plugin that works with Graphene 1.4. I’ve downloaded and activated ‘WordPress Related Posts’ plugin but can’t get it to work. Any help would be appreciated.

    #16732

    I actually see two plugins with this name. The first, by Denis, would require you to add this code to your templates:

    Place <?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.

    Ken

    #16733

    I tried using the first plugin (by Denis), adding this code to my child theme’s functions.php file:

    add_action('graphene_after_post_content', 'related_posts');

    function related_posts()
    {
    wp_related_posts();
    }

    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_content action hook. You can add it someplace else by using a different action hook. The complete list of Graphene action hooks is here.

    Ken

    #16734

    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.

    Ken

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.