2

I want to display posts from the past 3 days, ordered by meta_value_num. Then when you reach the final page, I want to loop through another 3 days and show those posts. So navigation never ends, the user can browse through every published post...

How can I do this? My WP_Query() arguments are:

$args = array(
    'post_status' => 'publish',
    'posts_per_page' => 5,
    'paged' => $paged,
    'order' => 'DESC',
    'orderby' => 'meta_value_num',
    'meta_key' => '__votes',
    'date_query' => array(
        array(
            'after' => '3 days ago'
        )
    )
);

That shows posts from last 3 days. 

1
  • And what will happen when pagination ends ? Pagination will be appended with new page links ?
    – Sumit
    Commented Feb 24, 2016 at 17:10

1 Answer 1

1

It may be that you could use some sort of lazy loading plugin. This could be done in a custom way using admin_ajax and adding user events but there are a number of plugins available that may be able to help out.

This plugin - https://wordpress.org/plugins/ajax-load-more/ - allows for the implementation of the lazy loading of posts and may be what you require.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.