Home Forums WTI Like Post PRO Most liked shows the same posts in pagination

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #279
    johnc1979
    Participant

    Hi,
    I have just purchased the plugin and have it running on my staging site to set it up correctly. But I’m having a few problems I’m hoping you might be able to help me with.

    I’m using the most liked template to show the most liked posts (I created a dozen for testing). When I paginate from page 1 to page 2 and from page 2 to page 3 it continues to show the most liked at the top before showing any other posts. Is there a way to prevent it from displaying posts that it has already shown?

    Thanks

    #281
    Webtechideas
    Keymaster

    We have sent you a modified template file. Please check that and let us know if that worked for you or not. For reference the modified code to be used is put below

    // Get the current page
    $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    
    // Query to get all posts sorted by like count after a specific date
    $the_query = new WP_Query(
    			array(
    				'post_type' => 'post',
    				'posts_per_page' => get_option('posts_per_page'),
    				'paged' => $paged,
    				'meta_key' => '_wti_like_count',
    				'orderby' => 'meta_value_num',
    				'order' => 'DESC'
    			)
    		);
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘WTI Like Post PRO’ is closed to new topics and replies.