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
- Print Current Post Index number within Loop
- the_author() returns empty string
- rewind_posts() – what actually the use of it, and where using is required or preferred?
- How to show list of posts by author and category?
- Override the default number of posts to show for a single loop?
- How to display posts by current user/author in a custom page template?
- WordPress Number of Posts Not Changing With posts_per_page
- Find most recent authors
- Query only Posts from Both of Two Category?
- Insert custom div between posts
- Get the author of the latest revision
- loop not displaying posts on custom template page
- Displaying the number of posts in a custom loop (without including the number of posts of a loop below)?
- Converting multiple loops into one single loop with pagination
- Exclude posts with empty post_content in wp_query
- Alternating post layout
- Check to see if specific loop has less than certain amount of posts
- Multiple loops are not reset
- is there a way to show the the post title after the image?
- Post Loop Missing Most Recent Post
- Display an author’s posts on his own author page
- Start WP Pagination From Number 1 in URL
- Use two different post_per_page limits with infinite scroll
- Query Posts by Custom Field
- How to get posts from a current post’s month?
- While loop articles – if statement order
- Change all author links in Blog roll
- Posts – display all posts except a post by an ID
- why the same code got different results when using query_posts in functions.php and index.php
- older blog posts not showing in new theme
- WordPress Query Posts From Category Post on Static Page
- Loop through posts? Want to remove extra newlines in actual post HTML/content on backend
- How include css class based on post ( in loop ) slug?
- WordPress Loop: How to display recent posts in multiple divs
- Random posts that always include a particular post?
- Cannot implement byline into posts container in single.php
- How to check if there are posts with the same tag
- Accessing Post ID Within Loop
- Different number of posts per row in grid layout
- WP_Query of Category Not Showing First Post
- How come this loop is not working? [closed]
- Using the loop to set locations for all posts on a single google map
- Change content off every sixth element
- Separate top level categories on archive-product.php by meta
- While loop in functions.php outputting the_title() of each post on frontpage
- Shortcode for Comments and Comment Boxes in Post Loop
- get posts, run a custom query, and join the results
- Show posts from two specific category in WP_Query
- Permalink Short code showing unnecessary link text inside the loop
- How to create loop of posts except post ID defined via ACF field
- Multisite how to display merged posts from two sites and sort by latest date?
- How to display particular categorie’s post which associated to specific user?
- Double loop output
- post->ID displays the same ID number for every post
- How to correctly escape data
- Posts are not showing up on next page.
- Sort Events by Venue Title – Sort Post set by related post ids
- Post are not showing up
- Get posts by category or author
- How to make post button to a random post
- Keep post format class with isotope filter
- How to pass multiple checkbox values to wordpress query?
- How to get all post titles starting with numbers and symbols?
- How to get alphabetic listing x other posts, based on first letter post?
- 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?
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- posts_per_page – Repeats only first posts ‘post__in’ array
- query_posts different amount of posts per page [duplicate]
- Sort Posts Alphabetically Based on Specific Category (Divi)