Show post with enough of upvotes on homepage

So I’m using wordpress with a updownupdown plugin (plugin for upvoting/downvoting posts). What I am trying to do is to show post with ,let’s say at least 10 upvotes, on the homepage and hide the post with not enough points.

I tried to us this code in index.php

Read More
if (have_posts()) :
    while (have_posts()) : the_post();
        if (up_down_post_votesscore(  get_the_ID()) > 10){
        //content
        }
    endwhile;
endif;

and it kind of works, it hides all the post with less than 10 upvotes, but it doesn’t put all the qualifying posts in one page (homepage has a pagination), so let’s say there is 2 pages with 5 posts and there is 2 posts in each page with needed amount of upvotes, so instead of putting those 4 posts in one page, it shows only 2 qualifying post in each page.

Related posts

Leave a Reply

1 comment