First of all you need to get all users calling get_users()
function. Then you can use count_user_posts()
to display post count for a user.
Try below code.
<?php
$blogusers = get_users();
// Array of WP_User objects.
foreach ( $blogusers as $user ) {
echo 'Number of posts published by '.esc_html($user->display_name).': ' . count_user_posts( esc_html($user->id) ).'</br>';
}
?>
Update : You can easily use wp_list_authors()
function also.
<?php wp_list_authors('show_fullname=1&optioncount=1&orderby=post_count&order=DESC'); ?>
Related Posts:
- Prevent WordPress from automatically installing a new theme each year
- Can we use one WordPress installation for multiple databases, domains and content directories
- When adding a custom REST endpoint, where do you put the endpoint function, and where do you put the function registration call?
- WordPress objects class reference
- Customizing gallery shortcode in 3.5
- Can You Export Theme Settings From WordPress Multisite?
- Adding Custom Fields to WordPress Comment Forms?
- How do you add pages on a staging server, and then move them over to production
- Any Hook Called When Post Becomes Published?
- Automatically wrap post image in div
- How Can A Widget With Only One Instance Be Defined?
- Getting $comments outside the comment template
- Theme Twenty Fifteen: Customize Color Scheme Customizer
- How to handle security on a wordpress site? [closed]
- Find and replace domain name on the fly?
- What is the most idiomatic way to let clients edit phrases in HTML?
- Is it possible to set default values for custom fields in a custom post type while my plugin is being activated?
- How to change “Dashboard” text in wordpress
- WordPress Template not affecting the working, keeps defaulting to the index.php template
- Custom Widget form function common elements
- Reinstall WordPress Without Losing Data
- Paginate Author’s Post List on Custom Author Page (ANOTHER THEORY)
- WP Northwind for Theme Development?
- list/consult Taxonomy only for the respective author/creator in dashbboard
- How to insert a sitemap within a subsite when using WordPress multisite
- How to check if site is created by wordpress? [duplicate]
- Enabling Additional CSS / custom-css
- Child Theme – how to add new widget on a specific place?
- Modify Gallery Output to render differently on a PAGE and a POST
- @font-face is not working in WordPress
- How to Call a static page in WordPress
- Add google org chart to wordpress page
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- How-To add Custom field in WordPress wp-ecommerce Categories?
- What changes we need to make to a theme so it can be installed as a MU Theme?
- Create custom dashboard for Multisite admins
- Get Custom Logo Alt Text
- The function can not create a table on MariaDB server
- Child theme .css files are not overriding their parent .css files
- One WordPress Installation for 2 Domains
- result from custom filter admin table list backend does not work
- Highlight comments of all the site authors
- Set Title from Custom Template
- For a specific theme, how do I build a list of all the possible theme modification names?
- Allow guests to use WP Customizer but disable save button
- Can I add/replace the WordPress image in the Dashboard
- Post thumbnails not working in my new install of WP 3.1 with Twenty Ten theme
- Blog page problems
- Installing new theme on running site
- How to insert a writing panel between the title and the page content?
- Switch between WordPress websites easy for an end user
- I’d like to be able to programatically setup a site to discourage crawling by search engines
- Show custom message/info for authors in add/edit post page
- dbDelta not creating tables with composite keys
- Create a page that dynamically loads data
- How can I apply custom sanitization to new usernames?
- Divi theme: change overlay color from default blue to back [closed]
- Hide content and functions from specific user roles
- Translating (WooCommerce) placeholder text
- Display content of metabox if filled in
- User profile Pick a premade Design/theme
- Recent activity query WordPress
- Woocommerce custom archive page custom content and shortcode
- Page flickers in customization mode
- We are facing this error in header unable to understand the issue
- When is the wp-settings-[time] cookie generated?
- Get All Results From Other Users That Share The Same Custom User Meta As Current User
- Can we set a redirection with dynamic content in url?
- How to remove (…) from the post tilte on homepage?
- Swap home page based on user role, Elementor layout breaking
- Customized Blog/Latest Posts Page
- How can I setup a development environment which auto refresh page when code have changed [closed]
- Password Protection issue
- How Can I add show_post_count in get_archives_link?
- Trouble with custom login page
- I want to use a product thumbnail completely different than the product image
- How can I edit the WordPress menu link to allow fb: instead of http
- Fixed bottom menu on mobile doesn’t work on search included in Child Theme of Storefront
- Change Dashboard menu position?
- Get site ID from attachment url?
- how to edit or remove the dashboard footer message [duplicate]
- admin aoolbar add_node() and pulling in my post slug
- duplicate featured image functionality in custom meta box
- How to automatically pull an information from a form field onto an other page?
- How to create a custom menu for specific user
- Custom Form Input not saving to Database
- How to create 2 preview button in a post?
- Move text from the side of image to below image [closed]
- How to work around the bug which prevents custom menus from being deleted?
- Custom terms in custom category taxonomy
- Customize TinyMCE Buttons
- Setting Custom WordPress “Posts page” AS “Front page”
- How to remove the tagline from the HTML ?
- Custom table or form
- How I can add blog in my magento site?
- Adding Telescope / Meteor App to existing WordPress site
- Instead of Custom CSS Theme CSS is loading
- I need to make the title of the page dynamic in my custom plugin
- Custom CSS working on home page but not on NEW created PAGE
- Custom Menu (only showing direct cildren) ACF not showing