• Hi,

    I try to display related posts in a widget with this php code, but it doesn’t work.
    What’s wrong in my code ?

    <?php global $wp_query;
    if(is_object($wp_query->queried_object) && $wp_query->queried_object->ID)
    {
    if(function_exists('related_posts')) {
    echo "<br /><h4 style='text-transform:uppercase; font-size:16px; font-family: Oswald,arial,Georgia,serif; line-height: 1'><div class='widget-top'>Les chroniques</div></h4><br />";
    }
    related_posts();
    }
    ?>

    https://www.ads-software.com/plugins/yet-another-related-posts-plugin/

  • The topic ‘Display related posts in a widget’ is closed to new replies.