Infinite scroll usually requires some kind of Javascript library to load more results via Ajax. The basic idea is this:
- User arrives at your page, you show, say, 5 posts per page
- They scroll past a certain offset and you use JavaScript to trigger an Ajax request
- Your request passes the requested paged, the endpoint receives the request, and returns just the HTML of the posts you want.
- You handle the Ajax response and insert the HTML in to the page
Here is a good writeup from Smashing Magazine on how to determine if infinite scrolling, pagination, or “Load More” is best for you.
Some other tips:
- You probably don’t want to load all posts at once – this may not be an issue now, or for a long time, but eventually this will come back to bite you
- There are plenty of plugins and tutorials for doing this, you just need a good understanding of how it works
Related Posts:
- Get posts from Network (Multisite)
- Get Recent Posts by Date in Multisite
- switch_to_blog() performance considerations & alternatives
- Merging multiple wp_query objects
- Pagination/infinite scroll with WP_Query and multiple loops
- WP_Query on different site in a multisite setup
- How to get post from all Blog Multisite to the Main Site?
- Ajax Infinite Scroll In Custom WP_Query Loop Not Working
- Get posts from the Main site to sub site – WordPress MultiSites Network
- How can i get the last post from wp multisite?
- Database Queries Optimization with new WP_Query
- WordPress multisite – fallback on subsites to main site on 404 and dealing with switch_to_blog function
- Need Help For WPQuery
- Multisite – Global CPT – advices?
- Changing sort order for presentation by Jetpack infinite scroll
- Multisite wp_query & switch_to_blog issue
- the_post() within switch_to_blog() altering my excerpt
- Redirect to another page using contact form 7? [closed]
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- Different query result on local and server
- How to count posts in loop with infinite scroll?
- Can I force WP_Query to return no results?
- Use the page slug in a WP_Query?
- Sorting: custom query with orderby meta_value_num THEN by title
- paginate_links() adds empty href to first page and previous link
- Using OR conditions in meta_query for query_posts argument
- Get posts by menu ID
- count posts from custom taxonomy terms by year
- How to grab metabox value in wp_query meta_query key
- Woocommerce query by price range and custom meta key
- Get posts with condition on comment meta value
- Stop all SQL_CALC_FOUND_ROWS wordpress queries
- Move posts to top of WP_Query if in certain Taxonomy?
- WP_query ‘orderby=none’ Problem
- How can I create a WP_Query that returns posts where one meta_value
- ‘paged’ in wp_query doesn’t work
- Sorting meta_value as integer doesn’t work
- Display different number of posts from one category on the different pages
- How to display child posts in the parent category
- Custom Field Query – Meta Value is Array
- WP_Query for showing specific post by id
- Ordering by meta_value AND date NOT WORKING with wp_query
- Query by custom dates in UNIX Time
- Custom WP Query from meta_value stored as serialised array
- Get List of all the Authors
- How to check if a post “does not have term” in conditional statement?
- WP_Query returns more results than expected
- Make WP_Query more efficient?
- unable to retrive parent page information
- Which method is faster to get a single post?
- Site not getting correct featured image from my query
- Using WP_Query within an mu-plugin
- Use more than one query, but prevent duplicates – at scale!
- WP Query related posts by tags
- How to add posts, manually, to a wp_query?
- wp_reset_postdata() does not work as expected
- Search Query for multiple categories using ‘OR’ but having certain categories be ‘AND’
- WP_query with OR relation between args[‘s’] and arg[‘meta_query’]
- Stale $GLOBALS[‘post’] after custom WP_Query empty result set bothers my template, whose fault is this?
- How to count posts with specific arguments
- Why post__not_in is ignored?
- WP Query with multiple tags by get the tags
- Woocommerce pagination and result count after custom loop
- Include latest author posts with pagination in single template?
- How to querry for an item that saved in an array?
- Is it possible to add an argument to a custom function added to a filter hook?
- Order by meta_key doesn’t work
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- CPT category post/content is not showing on my page, Please review my coede
- how to get category`s slug in WP_Query loop?
- Trouble building a custom WP_query
- Category based on post id
- Advise on Templates for Custom Queries
- Query WP Page for Buddypress Group Home [closed]
- How to separate two columns from one content on a page template?
- Get Post Title from different post type based on current loops post_parent using
- WordPress rewrite with custom parameter doesn’t work
- How can I order a post query’s results based on the number of matching taxonomy terms?
- wp query to use both author id and meta_query
- wp_query with meta_query and tax_query
- WordPress live search and filter custom fields
- Avoid removing duplicate posts
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- WP query retrieve the src of attached image
- How to set up pagination for a custom loop on a global template (author.php, tag.php, archive.php?)
- Featured Image as Background with Offset
- custom WP_Query results in showing same posts in all pagination pages
- counting post from a wp-query using sticky_post
- Query posts in current category but not attachment format
- Using orderby with 2 meta keys
- wp_query – Modify $query to include duplicate content
- Query to get all the posts of more than 2 meta_value having same meta_key?
- Query specific number of posts for each post type in specific order
- Avoiding page loop
- Query Users by post count, last 30 days and display each users post count according to post type
- how do I exclude child categories from a wp_query?
- how to show only catergory titles on a page in wordpress
- How to retrieve _embed (etc) fields in get_posts custom query?
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- How to save the results of a query as a php file for an autocomplete search bar