add to functions.php
function wpc_body_class_section($classes) {
if (is_user_logged_in()) {
$classes[] = 'CUSTOMPOST-'.count_user_posts(get_current_user_id());
}
return $classes;
}
add_filter('body_class','wpc_body_class_section');
Related Posts:
- post body class for current user only if they are the post author
- Custom Taxonomies in body class with parent slug
- Add body class to custom post type
- ajax response not recieving
- Reordering admin columns for CPT with custom taxonomy and an added custom field
- Getting post attchment URL to populate a CPT Admin Page Column
- The Difference Between Categories and Tags and Taxonomies and Terms
- How to build a WordPress post review system beside commenting
- Pagination doesnt work in custom post type
- Route subpage to Custom Post Type
- Custom REST endpoint not working to retrieve single posts (“rest_no_route”)
- Archive links for custom post types
- singular_name label in custom post type
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Many to many to many custom post relationships
- how to create custom post type with dynamic category_name using shortcode
- How to get dropdown instance value in WordPress custom Widget
- page template as a custom post type archive page
- Use core block functionality in a custom block gutenberg
- Which escaping function should be use on register_post_type label?
- widget_posts_args not using the number of posts in widget
- Add form after woocommerce admin order edit
- Show All Custom Post Types On A Single Archive Page
- Include custom post type custom taxonomies in Categories widget
- Show message when query has no posts
- Template Hierarchy for custom post type pages
- Display message if no posts in Custom Post Type loop
- Unable to edit categories in custom post type
- gutenberg message
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- Get category if used in a custom post type
- Iterating through Object Array to customise display of full custom taxonomy for custom post type
- Sort custom post type by most current date picker
- Return number of all custom posts type by author in all statuses
- I can no longer post or even save a draft, getting the error “A post type mismatch has been detected.”
- Get taxonomy term by slug in post on archive page
- WP_Query of custom post type sorted by meta_key has unexpected results
- Displaying custom fields for custom post type generate with Custom Post Type UI Plugin
- WordPress hook after post content and meta update
- Query not work for current taxonomy
- Using menu_position to add two entries between Dashboard and Posts
- Custom Post Type “MUST NOT” be able to search via URL
- I am trying to get cutom post cout by month of current taxonmy term
- When updating non-public custom post type it says “Post updated. View Post”
- How to show all taxonomies within custom post type loop
- Showing taxonomy terms on custom post type
- Create short URL with auto 301 redirect
- Custom taxonomy template list not working (404)
- Published post auto change status to pending after 90 days
- How to retrieve all wordpress posts (specific type) inside a function in php?
- Add shortcode inside of the_content()
- Create a page by importing data from an XML file ( On clicking a button inside admin options page)
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- ACF for custom post type archive pages: which hook to use?
- How To Post WordPress Custom Post Types to Twitter via IFTTT
- Custom Post Type Category URL
- Want a custom query with just one category but from all custom post types
- Pagination hitting 404 page on /page/4
- Convert comma separated list to serialized array to import as post meta
- WordPress CPT custom custom label
- Custom Meta Box returns no HTML
- Link From Single Post To Taxonomy Term Archive Page
- How do you output an unknown number of images in a custom post type with desired markup?
- `save_post` hook called on inserting new post from front end
- WordPress Custom Post Type and Shortcode for Portfolio Items
- Metabox multiple custom post select -> display selected items?
- Remove categories taxonomy from custom post type
- Custom post type’s posts are not showing anywere but in xml sitemap
- Get data from PHP to JavaScript to set position of each post on front page
- Child theme blocks post from publishing [closed]
- Generate new post from email
- I want to fetch custom post data based on it’s id i fetch from select drop down [closed]
- YOAST SEO won’t work on custom post type archive [closed]
- Undefined $post in wp_query
- Get posts from Custom Taxonomy
- display the posts of Custom Post type in custom category
- CPT Taxonomy As Archive Page – Error 404
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Can’t delete a custom post in front end with custom role
- Pull in taxonomy field of custom post type in new query
- Add term slug in URL of custom post type details page
- How to add a filter to a custom post type to get adjacent custom posts via the REST API
- Returning a custom content types with meta values
- Use the custom post type archive for taxonomies?
- How to define the template for custom posts?
- Adding Multiple Post Types to Query [duplicate]
- WordPress hook which triggers on post import
- How to display hierarchical and non-hierarchical taxonomies?
- Get parent category(taxonomy) ID from single template of a custom post type
- Custom Post Type Categories URL not displaying posts
- Auto post creation
- Change WordPress custom field default calendar [closed]
- Check if user has custom post published redirection on WordPress
- Custom order of Taxonomy Terms
- Dynamic CPT / Taxonomy
- Custom post type permalink returns 404 when set to private
- Rewrite custom post type with taxonomy
- Show all Tags in each post
- Custom posts of one type have disappeared from admin. Still appear on site [closed]