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 for ‘staff’ versus using wordpress user profiles?
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Prevent trash/delete action on specific post types
- Displaying category archive of custom post types
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- Filter for “get_post_type_archive_link()”
- Multiple Paginations on one Page
- Create permalink structure for one taxonomy archive per custom post type
- Page is defaulting to archive page and not designated template
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- Display all custom post types in archives.php
- WordPress custom post type category pagination 404 Error
- Show Custom Post Type by Author
- Custom post type archive with pagination?
- Custom post type tag archives don’t work for basic loop?
- Removing CPT slug from URL results in 404 error for archive page
- How can I get the last posts by user role?
- Disable single pages and archives and keep preview
- WordPress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels
- Custom post type with tags
- List custom post type but redirects to home page
- Custom Post Type with static page for archive
- Custom-post-type-archive: posts sorted/filtered by year?
- Custom post type archive page pagination
- Need post_type_archive_title function but in ‘single’
- Second Custom Post Type Archive
- How to show the archive / post type description on Single templates
- is_main_query() not working for WP REST API
- Hierarchical Custom Post Types – Show only parent on tax archive?
- Custom post types archive redirect
- Archive page for taxonomy terms
- How can i change the output of posts_nav_link();
- Roles for Custom Post Types
- Custom Post Type with archive page but no detail page
- Why is my site using index.php instead of archive?
- Custom post type archive page blank
- How to restrict author to only access one custom post type ?
- Associate multiple users to custom post type
- Archive for CPT
- How can I get this request to use the Custom Post Type page template instead?
- Custom post type posts don’t show in archive widget
- Archive for a Taxonomy of a Custom Post type
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- How can I use archive-{post_type}.php theme template?
- Return the name of the post type
- how to associate several authors to a custom post type
- Set a hard-coded page-template (post-type-archive) as home/front-page of my wordpress blog?
- archive as a page, so that it can be added in the wp_menu_nav
- Check if user has comment on current post
- Query within a foreach within a query (queryception)
- Archive links for custom post types
- Show All Custom Post Types On A Single Archive Page
- Custom Post Type setup
- Dynamic category name in query post
- Custom Post Type Archive Pagination
- How to know which archive page is active
- Preventing role reading others posts
- Archive Template being used instead of Category Template for Custom Post Type
- pre_get_posts works in post type archive but not in single post
- How to have multiple archive pages?
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- How can I increase the post count for custom post types only?
- Listing authors and date archive from custom post type
- WordPress sitemap with Custom Post Types
- Is possible register two archive pages for single custom post type?
- Display custom post front end filter by ACF equals current user
- Link custom post type to users membership
- Show all post type posts in manage users posts column
- Custom Post Type Archive Page showing as 404
- Limit 1 post by user in each custom post type
- Custom Post Type archive page listing a 404 or single post
- Add WordPress users to a custom post type
- Custom Post Type Query by user id
- Custom post type pagination problem – page 1 and 2 show same content
- The page or ad listing you are trying to reach no longer exists or has expired
- One of my headings is mysteriously coming up as a link in my CPT Archive
- connect users to Custom post types
- I broke it! Custom post type archive gets redirected to home
- UPDATED: Save a custom_field value when automatically creating a post using wp_insert_post
- Custom Post Type tag taxonomy “Page Not Found”
- Custom nav menu current item custom link problem
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Associate custom categories to different user IDs
- Stop Custom post type from being searched via URL
- archive-{custom_post_type}.php not getting recognized wordpress
- Custom post type category page not working
- Custom Post Types Archives and daily/monthly joke
- Display and Allow users to edit their own profiles
- Categories in custom post types
- Display results from two Custom Post Types in page template
- How to make a list of posts displaying them 5 by 5 with a “next posts” link?
- is_singular won’t call my functions?
- Query Custom Post Type and sort by year
- Custom post types not using archive structure
- WordPress and Unity high scores table
- Pagination not working for archive
- Remove plugin’s custom post type archive page and single pages [closed]
- Custom Post Type posts not getting picked up in archive widgets
- How do I get an intermediary page between 2 custom post types?
- Custom Taxonomy archive with url parameters