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
- Should we trust the post globals?
- Prevent Authors from viewing each others Posts
- Display Random Author with Details in Sidebar
- How to know if get_posts() failed?
- Query posts distinct authors
- Restrict the Number of Posts an Author can Publish (over time)?
- Duplicate posts
- Looping through posts per category gives same posts for each category
- How to show posts rank based on custom field value
- Get current users post URL?
- How do I create Comma Separated list of attached image ids?
- 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?
- Post author is changed to admin after his post is modified by admin
- How can I control multiple editing of wordpress posts?
- Multiple authors for single post without plugin
- How can I get all posts data from within a paginated search result?
- 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
- How can I list random authors from current post category?
- Query posts from different categories in multisite
- Check if post exists
- Only display posts after current date
- How can I show wordpress posts based on author?
- Limit posts per author role (excluding admin) in home page
- WP_Query Authors OR Categories
- Guest Author – How to display posts on /author/ archive page
- How to give capability (publish contributors posts) to author role?
- Getting the current author (it has changed) of a post, not the original author
- get query() without post content?
- 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
- Dynamically switch template on click
- Show comment number per author per day
- Get all custom post types excepted some…
- (solved) getting post author’s user role
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Counter is skipping post when I still want it visible [closed]
- Do not show children of a category
- post__in not working with pre_get_posts, but post__not_in does work
- How to get all post_parents of a post?
- If contributor has published 2 or more posts then show otherwise hide
- Run query_posts if SESSION is empty?
- Change post author without using wp_update_post()
- How to give classname to post if post has no content?
- Exclude some posts from displaying in wp_query based on some condition
- How to retrieve certain number of images from a wordpress post?
- Restrict displaying posts to the poster itself (in Back-end)
- Send email to author of post on post submission
- How to convert query sql to shortcode in wordpress?
- How can I set a maximum allowed post size and number of posts submitted?
- Get x recent posts by author?
- Some doubts about how the loop work (trying debugging it)
- Author Avatar as default first image
- Cannot select certain authors for posts after import
- Display message depending on capability outside loop
- How do I disable the “by author” hyperlink on posts?
- Adjust the order for returned posts
- get last post’s link with SQL query
- Trim posts from WP-Query?
- Prevent 404 of Author pages without posts
- Trying to exclude custom posts based on date, while sorting by custom field
- how to show comments only author which send own posts in wordpress
- how to add tags to post in the Loop?
- Merge get_comments & get_posts into a single query
- How to optimize posts query in wordpress
- Author post count in category
- How to search through “post title” and “tags” using WP_Query?
- Display post by Random Authors on Page Refresh
- Need to display a Jan 1st post as the site’s front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc
- I have two post types in the same query, how can I use CSS to select only one post type?
- On WordPress Search, how to search post from Author meta also
- Bulk Post update_post_meta
- How to hide meta from search result only on pages?
- How to run select query of post with category and tags?
- Query posts from newest category
- Custom author search
- Custom Select Query pagination not working properly
- Sort / Filter Queries
- Query post category & remove any post id
- Display the latest post from some selected authors
- Ordering posts alphabetically by meta keys and title
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Grab next post title in archive page
- Continuous listing from a custom field
- Getting posts from multiple users?
- Display the current post author and his url in the post header
- Displaying Results From Custom Taxonomy Query
- How to store post rating system data post independent?
- Get first comment link on the post itself
- Make division in post_query?
- Display one post randomly from category on home page
- how to show all type of author posts in author page (SOLVED)
- How to show total view count across all posts for an author
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields
- users followin the blog post author
- Change permalinks in posts via SQL