insert this code in your theme functions.php and use this shortcode [users_count_bro] to display where you want
function total_count_bro() {
$out="";
$user_count_data = count_users();
$avail_roles = $user_count_data['avail_roles'];
foreach ( $avail_roles as $role_key => $role_count ) {
$out .= $role_key.':'.$role_count.'<br/>';
}
return $out;
}
add_shortcode( 'users_count_bro', 'total_count_bro' );
Related Posts:
- How to display the names of users from a specific group with a shortcode?
- Audio or playlist shortcode condition according to the amount of files on attachment page
- Register visits of my pages in wordpresss
- create shortcode to list users with specific meta key value
- Enumeration Contact form using database table’s numbe of rows [closed]
- Create a shortcode that creates a form for users to edit their information
- How to list users by custom field?
- Multisite – maximum number of users with specific role
- Create a function to display HTML/data based on site admins role?
- How to insert current user ID/entry ID into a shortcode?
- Check if Page=current user page via shortcode
- Getting a List of Currently Available Roles on a WordPress Site?
- Editor can create any new user except administrator
- How do I programmatically set default role for new users?
- Custom shortcode being executed when saving page in wp-admin
- Change appearance of shortcode text inside editor
- Shortcode output always showing at top of page
- How to detect if a Shortcode is being called on a page?
- Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes [closed]
- WordPress gallery ‘post_gallery’ filter doesn’t work with feeds?
- shortcode to create dynamic dropdown box form shortcode attributes
- Ajax not returning anything on form submit
- How do I add my own custom shortcodes?
- Can’t seem to get [shortcode]s to work
- How to get the Role Name of the current user? (WordPress)
- nested Shortcode doesn’t work
- Slow page loading when using a simple shortcode on the same page multiple times
- TinyMCE get selected text and underlying HTML
- Remove and restore one shortcode
- Rewriting WordPress Gallery Shortcode with Bootstrap Carousel
- Using do_shortcode with variables?
- Using ACF field in do_shortcode()
- Display content from another site page using a shortcode
- Remove hyperlink on gallery shortcode
- Register rest field for specific user
- Combining similar shortcode functions?
- Creating a shortcode based on users preferences
- Get a post’s thumbnail url or display default image in shortcode
- Convert HTML Script to Shortcode [closed]
- How to build a shortcode which can insert a query string into a DB table
- What is the Correct way to pass parameters in function
- Shortcode – Getting Categories appears on top of website
- Are User Levels Still Currently Used?
- How to Modify WordPress Default Image Gallery Shortcode
- Passing html tags as shortcode parameters
- Registration Form Shortcode
- User’s total comment count excluding comments on their own posts
- Button Shortcode
- Conditionally Loading JavaScript/CSS for Shortcodes
- Placing tags on wordpress visual editor using shortcodes
- How do I let contributors edit their posts after being approved once?
- Replacement for gallery_shortcode function not taking all attributes
- Hide custom post type by user roles
- Fix ‘Add Role’ Option not there in wordpress 5.2.2
- how can i pass this attribute in this shortcode?
- How to add a same div on every page
- Display a form partially with a shortcode
- Modifying the wordpress login page and then referencing it with a shortcode problem
- Pass instance number to shortcode child
- Render shortcodes with get_post_custom
- Plugin permissions for Editor role
- Pass a comma separated shortcode attribute to a function
- how to write short code in word press
- Set redirect for need login
- make user_id in a shortcode dynamic based on who’s logged in
- Shortcode not working in CPT taxonomy
- wp_enqueue_scripts does not work on admin page
- shortcode containing other shortcodes not returning content
- To know whether insert shortcode in custom meta box
- Add Change role button for list of user in an event
- Third-Party API – PHP Fatal Errors Paired with http_request_failed / cURL error 28
- If statement shortcode
- Shortcode not working when I output data from wpdb html table row
- How do I point bloginfo(‘stylesheet_directory’) to my parent theme?
- Gallery shortcode is empty but magically creates a gallery
- How to avoid one code multiple times instead do that through some function? Shortcode, but I think shortcode is not used in main theme’s core files?
- Add a shortcode in woo-function.php
- Get current category and place it in shortcode
- Woocommerce products shortcode specific order
- Modify Blog Module layout in Child theme
- Display title of child pages in shortcode
- Output html source tags inside shortcode
- How can I define the output of shortcode attribute value?
- Using shortcodes that wrap around code
- Front end login and page restriction
- Shortcode for Admin Theme Option?
- Get author meta of all writers
- What is the best way to include a template file within a shortcode?
- What makes a placeholder resizable in Tinymce?
- Shortcode templates
- i need to let a user to add a role from a frontend form
- Why My slider shortcode display above header
- Does anyone recognize shortcode ig_special_heading?
- How to scroll to a shortcode-generated anchor
- add post type pram to wp shortcode
- Can I prevent wordpress adding and tags to autoembeds
- Shortcode – Display inline icon before text [closed]
- How to create a specific role to manage users
- How to reuse php templates as shortcodes?
- Shortcode attributes from meta query variables