The count_user_posts
accepts array as the $post_type
arguments. You don’t need to include the $post_type =
part.
$user_posts = count_user_posts( $userid, array('post','blog','lettura','intervista') );
The $user_posts
variable will hold the number of posts for the $userid
.
Related Posts:
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Why are posts from custom post type not displayed in “category” archive?
- Custom Post Type Archives by Date and Taxonomy
- Custom post types – Use post_id in permalink structure when using has_archive => true
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Custom Post Type Archives by Date with Custom Permalink
- How to add meta box to backend menu page
- Change title in head on Archive page
- Multiple Paginations on one Page
- Page is defaulting to archive page and not designated template
- User roles – enable custom posts disable posts
- Allow User to Edit Page Based on their Email
- WordPress custom post type category pagination 404 Error
- Custom Permalinks for Custom post Type Archives?
- is_singular won’t call my functions?
- Show Custom Post Type by Author
- Pages, Custom Posts & Custom Taxonomy defining slug structure
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- How to show a tag archive of one post type only
- Regex problem in an add_rewrite_rule
- Custom taxonomy archive page not working
- Change plugin’s has_archive = true to false?
- Assigning a role to a specific custom post type (and ignoring other post types)
- wrong template for page of archive
- How to show multiple post types on taxonomy archive?
- How to show custom post type count in the users admin page
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- Slug for standard post post_type
- Delete Current Author Frontend user while delete custom post type
- WordPress custom post type archive with description
- CPT: archive-cpt.php VS custom page template
- Get post type from taxonomy or category page
- Category page only displaying the posts from a custom type
- custom taxonomy archive by year
- Display custom post type taxonomies as an archive page
- Change name of custom post type archive
- When ‘is_post_type_archive()’ return true?
- Editable content on a Custom Archive page
- Second Custom Post Type Archive
- Link users to a custom post type
- CPT Archive with core Category
- Ajax Check Post Status
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- how to delete all users and posts based on ‘user_meta’?
- get the custom post type title/name
- Get archive post type name
- Tag Archive for Custom-Post-Type Posts yielding 404 when permalinks set to postname
- Filtering WP_Query
- Custom post type – get_day_link()
- Hiding posts by other users and non-logged in
- WordPress showing archive.php instead page
- Custom post type archive page blank
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Disable user from updating certain posts
- Query posts based on the meta key values of logged-in users?
- Custom post type / taxonomy rewrite archive page 2 gives 404
- how to remove pages loading with the archive templates
- Archieve.php not loading for custom post type
- Custom User role not working with custom post type
- get comments by current user inside page template
- Assign CPT archive page attributes
- Dynamically insert an article at the top of a taxonomy archive – or?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Can’t access private custom posttype single- or archives-page
- Display Date & Author Info on Custom Post Type Archive Page
- How to constrain the results to a specific post_type on tag archive page?
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- How can I relate custom post types?
- Add a custom post when inserting a new user in WordPress?
- Why does my URL keep returning 404 error code?
- Display CPT index page as front/home page
- How to prevent a custom post type from using the archive.php template?
- Event Archive by Month
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- Display all Categories except ones with a specific parent
- How to achieve a multi-taxomony layout with posts?
- Archive per year of a custom post getting the wrong post
- Creating archive like functionality through birectional relationships
- How to show custom post count in archive page
- Do not show child pages within a file page
- Tell wordpress to show a single page instead of an archive page
- Custom post type categories giving 404
- Autofill advanced custom field with user data
- Custom category taxonomy – archive page not showing up
- How can i remove post type archive URL?
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom taxonomy archive slug overwrites static page
- Reference field of users in custom post type
- Creating multiple profiles under one user to assign to particular posts
- Control what custom posts a user can see
- Rewriting archive page slug to be different than custom post type slug
- Site loads very slow for archive custom post type page
- archive.php can’t find categorized posts
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- How can I set up the URL for a category archive for a custom post type?
- Is it possible to remove the word “date” from archives?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Generate daily archive whenever any post type is added
- Show custom category archive as front page and remove taxonomy slug from urls