I’m not sure why your blank variable method should work, but it seems dodgy to me. I would explicitly set the posts_per_page to the number defined in settings:
'posts_per_page' => get_option( 'posts_per_page' )
Related Posts:
- Should we trust the post globals?
- Override the default number of posts to show for a single loop?
- get comments and get posts in loop
- Why do I need to use The Loop on pages (inside page.php etc)?
- Count singular post views automatically
- Looping through posts per category gives same posts for each category
- Display All Sticky Post Before Regular Post
- Get the author of the latest revision
- How to have different content in the loop and single
- Strange switch_to_blog() issue
- Multiple loops in same page, without duplicate content
- loop not displaying posts on custom template page
- Repost post on specific date every year
- Display Latest Post from all Categories
- The correct way to call posts with ajax
- custom wordpress post loop – hide iframe content
- Divide Loop Into Days & Categories
- While in “the loop”, detect if a post is the most recent
- Contact form 7 post loop [closed]
- How to display different number of posts
- If Specific Post, Link Elsewhere
- WP Query – duplicated posts once including tags in search results
- wp_tag_cloud() and the_taxonomies() work but not the_tag()
- Show all posts in sidebar in single.php
- Split WordPress Latest Posts in Multiple Columns and Rows with one single loop [closed]
- Avoid duplicate post from same Taxonomy
- Alternate row and columns every X posts
- Adding specific post category between posts in loop
- Best way to assign post position in a news site homepage? (no categories, no sticky posts)
- How do I restart my loop with get_next_post()?
- Child_of not displaying all children posts.. via get_posts
- Multiple loops are not reset
- Exclude category from
- How to exclude latest x posts from a paginated query?
- Posts will not display on page-mypage.php
- Pausing and Resuming WP_Query results
- Trying to use AngularJS with WordPress without any API
- How to : pagination in 3 different custom loops on the same page
- Sharing post from archive page (loop) doesn’t work
- wp_query random post
- How do I stop the loop from repeating in my category template?
- How many posts does the loop return?
- Display Posts on Custom Page
- Possible to alternate between two loops
- Get Value of Post before
- Multiple Loops Breaking Pages
- Second get_permalink inside loop points to wrong URL
- Use Click Image to Play Youtube Video in a WordPress Loop
- The_excerpt() doesn’t parse – how to change that?
- Trying to edit archive.php to only show post extract, with featured image
- How to only publish posts with image in it
- Extracting relevant tags associated with that particular single post only
- Why this function doesn’t works without the_post?
- Show posts by quarter
- Optimizing the blog loop
- Accessing Post ID Within Loop
- Some doubts about how the loop work (trying debugging it)
- Different number of posts per row in grid layout
- linking to post outside the loop
- Cant’ Grab WordPress Built-in Posts Through Loop
- Pagination for normal (standard) posts on a page with a custom loop?
- Defining ‘last’ class on foreach blog posts
- How to show full post on home page
- ACF flexible content block not showing on live site (works locally)
- Want to change the post every three days with in specific category
- Current post categories and subcatecories outside of the loop
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- “read more” redirects to the wrong page
- Count singular post views automatically
- How can I get the last post while on the first post for pagination? As if it were infinite
- Loop and output 4 rows of posts on home page
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- Loop through all posts showing duplicates
- Post being duplicated with foreach loop
- Custom post type – Loop out in random order but same 15 to appear first… still random
- WordPress infinite post cycle
- List Authors For Current Category
- Display the latest post from some selected authors
- Advanced Post Display/Pagination/Ordering
- How to show the posts list into a static page? Problems to use the loop into a static page
- Keep post format class with isotope filter
- How to use extract shortcode in loop?
- Adding a category at even positions on main loop with modified pagination
- Make assigning post to a specific category equivalent to assigning it to all categories
- wordpress taxonomy results
- Displaying posts on Homepage
- Where are my posts linked to? I keep getting a Not Found Error, and I have no single.php page
- Sort by category and then date?
- The loop: more posts than I want to fit on one page
- Loop not allowing infinite scroll after post per page limit
- Customise the appearance of 4 specific post ID’s within the loop?
- what template-part to call, to have my post in the center of the page?
- WordPress posts loop pagination – first page return 125 posts instead of 10 and the rest return 10
- The post order is different for logged-in and non-logged-in users? [closed]
- How do I show the post title if an advanced custom field hasn’t been used?
- How do I create a template page to show 3 blog posts?
- Custom post order returning posts from other categories
- blog post displaying within older post – loop issue?
- CSS code for “inserting a custom post divider” after each post
- WordPress Ajax load doesn’t work