You could have an authors totals array and on each iteration you would increment that author’s key:
<?php foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<?php $author_count = isset( $authors_totals[ get_the_author_meta('ID') ] ) ? int_val( $authors_totals[ get_the_author_meta('ID') ] ) + 1 : 1; ?>
Date: <?php the_date('d/m/Y'); ?>
Title: <?php the_title(); ?>
Author: <?php the_author(); ?>: <?php echo $author_count; ?>
<?php endforeach; ?>
Related Posts:
- Get all comments of author’s posts
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- Random sort within an already sorted query
- Hook that get’s triggered when the author of a post is changed
- the_author() returns empty string
- Prevent Authors from viewing each others Posts
- Display Random Author with Details in Sidebar
- how to get a different html for odd/even posts?
- How to show list of posts by author and category?
- WordPress: How to get the current logged in author page URL?
- How to add editor’s name to entry meta byline?
- Different permalink for posts and authors
- How to know if get_posts() failed?
- How to display posts by current user/author in a custom page template?
- Using $wpdb to query posts with meta value containing current post_id
- Query posts from current year
- Query posts distinct authors
- Restrict the Number of Posts an Author can Publish (over time)?
- WordPress Number of Posts Not Changing With posts_per_page
- Search posts by post author name
- Get the user type of an author
- I have over 4000 posts, will querying some of them cause performance issues?
- Duplicate posts
- Show the title of the latest post by author
- Looping through posts per category gives same posts for each category
- How to show posts rank based on custom field value
- Find most recent authors
- Show author post count in sidebar – Variable
- Get current users post URL?
- Get the author of the latest revision
- Filter posts by author and category simultaneously
- How do I create Comma Separated list of attached image ids?
- How to add posts to wp_query result?
- Custom Post Type & Author not associating, user post count is 0, api doesn’t return author in post objects
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- Trying to put an array into ‘post__in’ => array() query not working
- Post author is changed to admin after his post is modified by admin
- Order post by year DESC and month ASC
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- Get all posts by post_author
- How can I display a specific user’s first published post?
- Query All users that has post
- How can I control multiple editing of wordpress posts?
- wp_enqueue_media() slows down my WP site
- Multiple authors for single post without plugin
- Limit number of posts a user can make per minute?
- How can I get all posts data from within a paginated search result?
- Authors in menu, template list post by author
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- Author must complete profile info before they can publish a post?
- WP rest api returns 404 only when author param is used
- Search query – exact post title match
- Sorting posts alphabetical that have single digits
- How can I list random authors from current post category?
- Query posts from different categories in multisite
- Check if post exists
- posts_per_page doesnt work
- Sorting posts according to view counts not working
- Display page content AFTER a loop of posts
- Only display posts after current date
- Get posts by multiple ID’s (query)
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Improving WP_Query for performance when random posts are ordered
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- How can I show wordpress posts based on author?
- Show info to author only
- Auto “expire” all of an authors posts on spcific date
- Query how many items to show in shortcode
- How to get the user meta data for a post?
- Limit posts per author role (excluding admin) in home page
- Get posts by name and taxonomy term
- WP_Query Authors OR Categories
- Get Posts that are in the current month or later
- Guest Author – How to display posts on /author/ archive page
- How can I show many posts an author has per week?
- Sticky post appears twice
- do_shortcode within post query
- How to give capability (publish contributors posts) to author role?
- How Can I Query a Specific Page From a MultiPage paginated Post
- Get Meta Key Value While Saving Post
- Most liked page not displaying posts
- Query get post,how to add comment box
- Whitelist Author of Private Post
- Show posts by a custom post author
- filter RSS feed in URL
- WordPress custom Query for Posts in Category display posts multiple times
- Getting the current author (it has changed) of a post, not the original author
- get query() without post content?
- How can I setup a relationship using categories in WordPress?
- Exclude the first ‘n’ number of posts of a tag from home page?
- Showing author page if user has no post
- posts_per_page option limits the number of Gallery items
- How i can limit period of post publication?
- How to setup a query to output posts by groups of five?
- Display Notification Bar on Header on Certain Post Count
- How do I retrieve a users’ last 5 posts?
- Exclude current custom post on single post