• Resolved lightningman

    (@lightningman)


    Hi,

    I am using get_crp_posts_id(array('postid' => $post_id, 'limit' => 8)); to get the related posts. It works correctly, however I am unable to specify the minimum number of posts I would like to fetch, only the maximum with limit.

    How do I specify the minimum number of related posts? In this example, I would like to always get exactly 8 posts.

    Thanks,
    Chris

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ajay

    (@ajay)

    limit sets the exact or max amount of related posts. However, if there aren’t enough posts found then it will be less than the number specified by limit. The plugin doesn’t randomly fill in the remaining posts.

    e.g. if you have set limit to 5 and there are then related posts, then 5 are displayed.
    If you’ve set limit to 5 and only 2 related posts are found, then 3 are displayed.

    Thread Starter lightningman

    (@lightningman)

    Thanks for clarifying. Yes, I was looking for a way to randomly fill in remaining posts. Thanks anyway ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Minimum number of posts’ is closed to new replies.