Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2709

    I was wondering what the criteria are for determining related posts are and where it can be edited. I love how this feature is built into habitat, unfortunately the “related posts” on my blog don’t really seem to be as closely related as some that are not listed. I hope this isn’t a dumb question. I did a bunch of searches and couldn’t find anything in here answering that. Any help would be appreciated!

    #39015

    Hey,

    as far as I can see the related posts are determined via tags. In single.php you can find following code:

    <?php // related posts
    $this_id = $post->ID;
    $tags = wp_get_post_tags($post->ID);
    if ($tags) {

    $tag_ids = "";
    foreach ($tags as $tag ) $tag_ids .= $tag->name.",";
    $tag_ids = substr_replace($tag_ids ,"",-1);

    if($tag_ids)
    {
    $my_query = new WP_Query("tag=$tag_ids&showposts=7&caller_get_posts=1&orderby=rand");

    So posts which are tagged with the same words will be displayed as “related posts”

    #39016

    For whatever reason that doesn’t seem to be the case. It seems like they’re just randomly chosen (or not chosen when they should be). These three posts have nearly identical tags but are not listed as related. I really like this feature and think it looks great and would really like to get it to work. Thanks for your continued help!

    http://outsmartingfish.com/2009/07/up-north-the-bull-trout-that-got-away/

    http://outsmartingfish.com/2009/07/up-north-more-bull-trout/

    http://outsmartingfish.com/2009/07/up-north-the-long-awaited-bull-trout-hunt/

    #39017

    Try to change following line in single.php:

    $my_query = new WP_Query("tag=$tag_ids&showposts=7&caller_get_posts=1&orderby=rand");

    with:

    $my_query = new WP_Query("tag=$tag_ids&showposts=7&caller_get_posts=1");

    This should remove the shuffle feature. Maybe you’ll get better results.

    #39018

    Thanks! No luck though.

    #39019

    Still no luck. Any ideas?

    #39020

    Hi,

    Sorry for the delay.

    The more precise related posts functionality is heavy, thus in order for a serious algorithm to be able to find posts that are even closer related would come at the sacrifice of your website’s load time. Please, let me give you an example.

    A free plugin called YARPP is great at matching related articles. However, in order to do that it takes up a lot of resources (http://yoast.com/wordpress-performance-optimization/ 7 out of 16 database calls in this article. )

    Now the question is, are you willing to sacrifice your loading speed (which Google uses as an integral factor in its algorithm to determine your site’s placement in the search results), or do you want to have articles that are better match?

    If you can balance the inclusion of YARPP (http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/) through optimization, then it’s doable.

    You have a really sweet Server, very fast. (http://www.webpagetest.org/result/120901_Q7_d82decb70a6e960a601744599ec17ed1/3/details/) but you can optimize still a lot further. You can download the executive summary report on your website http://gtmetrix.com/reports/outsmartingfish.com/abHTFCcb/pdf

    Thanks,

    Nick

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

The topic ‘Related Posts Criteria’ is closed to new replies.