WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[Plugin: Yet Another Related Posts Plugin] Ignore sticky posts (4 posts)

  1. Remco Tolsma
    Member
    Posted 3 years ago #

    Should the related posts query not ignore sticky posts?

    $related_query->query(array('p'=>$reference_ID,'orderby'=>$orders[0],'order'=>$orders[1],'showposts'=>$limit,'post_type'=>$type));

    Like this:

    $related_query->query(array('p'=>$reference_ID,'orderby'=>$orders[0],'order'=>$orders[1],'showposts'=>$limit,'post_type'=>$type,'ignore_sticky_posts'=>true));

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Why should it? Sticky posts are still posts, right?

  3. Remco Tolsma
    Member
    Posted 3 years ago #

    Yes, but the sticky posts should not be added to the begin of the related posts returned. In the context of related posts the order should be determined by the relation with the reference post. As far as I know sticky posts will now always be shown as the first related posts.

    http://codex.wordpress.org/Function_Reference/WP_Query#Sticky_Post_Parameters

  4. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 3 years ago #

    Oh, I see, I see... I'll have to look into this for the future. Thanks for the heads up.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic