You can use the below to output the post amounts
<?php
$args = array(
'post_type' => 'post',
'showposts' => '10'
);
$wp_query = new WP_Query($args);
// amount of posts per on the page
$post_number = $wp_query->post_count;
// amount of posts across the post pages
$post_number2 = $wp_query->found_posts;
echo $post_number.'<br />';
echo $post_number2.'<br />';
while ( have_posts() ) : the_post();
php get_template_part( 'post', get_post_format() );
php endwhile;
?>
Related Posts:
- How to get posts published between a date and today?
- Display all posts from specific categories on a page
- How to exclude latest x posts from a paginated query?
- Display content from a specific category
- Can’t show comments count per post outside loop
- How to Display Post View Count
- How would I get 1 latest post from a query for 5 posts?
- Inserting custom data to the_post() during loop
- How To Get Posts With A Specific Word
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Display all posts that were published before full post on single.php
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- How to order posts in an arbitrary order?
- Display Posts on Custom Page
- Wrong post title displayed from loop
- How to get posts published on the latest date?
- How to only publish posts with image in it
- WP_Query: Show 10 posts in date order, first three random
- Display specific posts on home page
- Display 3 posts with different HTML markup using a loop
- How to show post views shortcode data for each post on Posts List Page?
- Use special template for the first post in the loop
- Modify WordPress loop after it has been run
- show latest authors blog post
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Adding a category at even positions on main loop with modified pagination
- How to inject a post within a loop
- Why does ‘get_the_ID’ work outside of the loop?
- Get first post from wp_query
- get comments and get posts in loop
- Query posts distinct authors
- Why do I need to use The Loop on pages (inside page.php etc)?
- How to get previous 10 days post from a specific date – WP Query
- Display All Sticky Post Before Regular Post
- Specific loop in Shortcode
- Repost post on specific date every year
- Search widget breaks when using multiple loops?
- Filter Posts By Tag
- While in “the loop”, detect if a post is the most recent
- Contact form 7 post loop [closed]
- If Specific Post, Link Elsewhere
- How to filter posts that belong to a specific category only if that is the only category
- Most recent post from another database
- Exclude newest post from category X but show rest
- Reset Popular post query?
- page.php showing loop of posts and not page content
- Child_of not displaying all children posts.. via get_posts
- Display posts with tag that matches current post title
- Trying to use AngularJS with WordPress without any API
- Pagination with an array of post objects?
- wp_query random post
- wp_posts table: safely remove unused columns to save database storage
- Possible to alternate between two loops
- Multiple Loops Breaking Pages
- Counter is skipping post when I still want it visible [closed]
- 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
- Extracting relevant tags associated with that particular single post only
- Why this function doesn’t works without the_post?
- wp_query with ajax
- How to give classname to post if post has no content?
- Custom posts listing widget always returns 1 extra result
- Show posts by quarter
- Get postlist for each category using query_posts?
- How to save posts position on homepage after random function?
- Cant’ Grab WordPress Built-in Posts Through Loop
- Pagination for normal (standard) posts on a page with a custom loop?
- How to show full post on home page
- 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
- Loop and output 4 rows of posts on home page
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- Make recent post display recent updated, instead of recent published
- Loop through all posts showing duplicates
- Manipulate query to show specific post
- Custom post type – Loop out in random order but same 15 to appear first… still random
- List Authors For Current Category
- Display the latest post from some selected authors
- get “read more” with custom DB query like you would with WP Query
- How to show the posts list into a static page? Problems to use the loop into a static page
- How to use extract shortcode in loop?
- 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
- The loop: more posts than I want to fit on one 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?
- wp trim function not working
- Custom post order returning posts from other categories
- CSS code for “inserting a custom post divider” after each post
- Count words for all posts by all authors
- Do I need to create a multisite for querying posts from multiple WordPress sites?
- WordPress Ajax load doesn’t work
- WordPress current post functions inside loop doesn’t work anymore, are they incompatible with php 8.0?