You can retrieve the setting for posts per page set under Settings > Reading
via get_option
:
$posts_per_page = get_option( 'posts_per_page' );
Related Posts:
- Split Content and Gallery
- Redirect loop when trying to login to /wp-admin/ [duplicate]
- Do I need to use The Loop on pages?
- How to return loop contents
- How to get the first image gallery of a product in woocommerce in a loop
- the_content and wp_link_pages
- How can I custom order the results from wp_list_categories?
- the_title(); works in a page template, outside the loop. Why?
- Add 20yrs to post date, and then query
- When and Why is is_singular(‘my_cpt’) true while in_the_loop() is false?
- as a shortcode within the loop?
- Getting page ID inside loop
- Page template not displaying
- How to show just private posts in loop
- How to paginate this custom loop? [duplicate]
- Select data from database and list it in Loop (WordPress)
- How can I modify the loop from a plugin without wiping out other filters?
- wp alchemy multiple image uploader output images to template
- Running a loop with a custom query string on a custom page template
- I’ve been out of the loop since 2.8. What did I miss?
- Loop first six posts in carousel, next eight in grid
- Complex query and posts pagination
- Infinite blog loop
- Displaying terms based on loop posts?
- Loop in Related Posts WordPress
- Conditional query that displays on Woo product attribute pages
- Custom post type appearing within the previous one on archive.php
- How do I go about looping through a advanced custom field on a particular page inside of another page
- How to inject posts from certain category on home page
- The Loop – mixed ASC and DESC order
- Filter the_posts doesn’t work on search page
- Showing sticky posts with get_posts()
- single.php – how to mark current page in the loop
- How to order by multiple fields using standard query_posts?
- Get 1 more post in loop
- Pagination not working in category listing [duplicate]
- Category links including all posts
- Custom loop ordering not working
- First archive page with a few posts
- Hiding a row in the loop if empty
- Loop through ACF taxonomies and output associated posts
- How to get user ID’s from multiple usernames?
- Pagination on custom post type on front-page.php
- get_template_part() Not Working in Loop
- get_delete_post_link() inside Loop stubbornly returns nothing
- Query posts only with actual text content (not including shortcode or images)
- Comments_template doesn’t work
- Get markup for post without loading into the template
- How can this multiple loop have pagination as described?
- Default featured image set as background image [closed]
- Breaking up the results of a loop
- how to run loop in function.php that sends email based on specific conditions?
- How to use this $tax_selection variable in this custom loop?
- Display all categories as plain text
- Exclude current post ID from loop in sidepbar.php
- loop inside a loop : search for posts in the same category
- How to sort a loop after most viewed
- How to declare a variable in a loop and make it available in the template file
- WordPress posts loop not displaying all posts on blog
- get_page_by_title not working inside fucntions.php
- Bootstrap tabs are not being clicked in WordPress loop
- Get gallery in loop through ajax
- Get a specific size from wp_get_attachment_image_src
- Pagination on a underscore custom theme
- WordPress + Isotope: how to give different widths to each entry?
- hide woocommerce tab if empty
- Get top Page IDs from menu and cycle through their child pages on a scroller
- Show other category posts in single.php
- Why does it loop twice?
- Style first 3 posts differently and use a 2nd loop to get rest of posts / offset and pagination broken
- Cant pull in featured Image
- Custom Looping of WordPress Posts
- how to place Post and page content side by side
- Add specific class to featured posts
- Echo Most Recent Sticky Post in Loop?
- Link Button url count php and wordpress
- ACF field not appearing correctly in loop
- Posts are being displayed from old to new, in ascending order
- Loop in taxonomy for terms and post
- WordPress Tags in class
- Query counting excluded category on paged loop
- Using shortcode within shortcode with dynamic variable
- modify default HAVE_POSTS() Loop without inserting new variable (i.e. $loop->HAVE_POSTS)
- Display articles related to a custom field on a page
- The Loop isn’t working
- Changing the loop w/o killing category links
- Custom loop page with post navigation
- Pages with a loop (index, archive) are loading the first image as post_thumbnail
- the loop – how to control whether wp or plug-in runs it
- stuck with template hierarchy
- How to create an identical second loop for attachments?
- An action that runs after each post in the loop on index/archive page?
- Modify my code – which takes the first sentence of the post and use it as a h2 tag – to work outside the loop
- How to show only specific tag in wordpress loop
- Different style for first two (sticky) posts
- WooCommerce – Checkout suddenly stops working [closed]
- Want to images load first then title in WordPress loop
- How to add a continuous number to HTML tag attribute value inside The Loop [closed]
- WordPress Not Sorting By Custom Field
- Hide old posts each year