You can use body_class
filter to check if you are on your custom post type, and if so then just remove the blog
class like this:
function remove_blog_from_cpt_classes($classes, $class){
global $post;
if ($post->post_type != "products"){
return $classes;
}else{
foreach($classes as &$str){
if(strpos($str, "blog") > -1){
$str = "";
}
}
}
return $classes;
}
add_filter("body_class", "remove_blog_from_cpt_classes", 10, 2);
Hope this helps
Related Posts:
- What does this PHP function code mean? [closed]
- Restrict custom post type to only site administrator role
- Linking Two Post Types
- How to force one column layout on custom post type edit page?
- modify all posts of a category to “no comments allowed”
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- Showing current taxonomy terms
- automatically create taxonomy with same name as post title
- Assigning a role to a specific custom post type (and ignoring other post types)
- Display posts in random post types
- Custom Post Type by user
- saving custom post type data to different table in wordpress
- Query post types with multiple keys
- [Plugin: Posts 2 Posts] Changing display order of connections
- same archive template for different custom post
- How do you use JavaScript to detect the homepage
- Get all posts WHERE custom_field is LIKE value
- Get the post children count of a post
- How to delete all posts from a custom post type?
- Check Title Unique Or Not and If not error message and dont save
- Remove All, Published and Trashed Post Views in Custom Post Type
- How to post twitter like updates on wordpress
- Show Two custom Post type and their posts on category page
- apply filters only to specific post listing without check the url parameters
- Deleting Custom Post type data using mySQL command
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Display only one post each WEEK
- List custom taxonomy specific to one custom post type
- Meta query for custom post type ignored in main query
- Show titles, date of all posts on single category page
- Update postmeta Parent when post_status child change
- Allow users to create posts without logging in?
- How to sort posts in a custom post type by title in ascending order by default?
- Redirect to another page using contact form 7? [closed]
- Get_the_terms restrict output
- Custom post type menu
- YOAST SEO won’t work on custom post type archive [closed]
- Separate Content from gallery (custom post type)
- Posts are not rendering perfectly [closed]
- WordPress Count posts within a custom post type
- Custom post type tags not showing in search
- How set template for “custom post type” individual post
- Why is my custom post content only viewable when signed into WordPress?
- Adding specific custom fields (images) to post excerpt
- Limit posts per page depending on the size of a div?
- Delete Post by User
- creating a custom post template
- Problem to get the link of the default ‘post’ post type like the orther custom types
- Change Background Color For CPT Template
- One Post with different content, depending on a Page
- Custom Post Type
- Display all post types together
- Turn post into simple slideshow
- Multiple Block Quotes without using HTML
- Query multiple post of which one by taxonomy
- How to make a template for a specific post of a custom post type?
- How to delete unnecessary custom post types in the UI
- How to create a job post by email parsing? [closed]
- show posts under custom post type with same autj
- How to automate the creation of advanced layout article/post
- display posts, pages and custom post types from another wordpress site
- is therer any wordpress function to retrieve a specific html element from post content
- How to develop Knowledge center in WordPress Website
- ACF – Tags not showing up in Custom Post Types
- A developer set a ‘standard format’ for my blogposts on wordpress but i need to remove it, how?
- I am having a problem with form updating/editing WordPress post on the frontend
- How to filter the taxonomy terms based on another taxonomy term
- Remove parent from custom post type
- CPT’s archive and single page not working [closed]
- Add the current menu item CSS class to a custom page type archive in WordPress menu
- How to create A-Z index listing for custom post types?
- How to make post sticky in the admin page?
- different template for first and second level custom post page
- How does the $post_type global variable work?
- get_template_part for custom post type content not working
- How to customize admin posts based on the user who is logged in
- Custom Post Type | Fatal Error on register_post_type()
- Loop on front-page.php
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Why my custom post posts aren’t showing (404 error / page not found)
- Custom Post Type, Saving Multiple Checkboxes
- How can I display custom post types under multiple views?
- Automaticly add slug to posts
- Change post featured image on hover
- How to get all `supports` attributes by post type?
- How to create an advanced filter search?
- WP_Query is printing out only one post when posts_per_page is set to multiple
- Trying to edit the single page from a Custom Post
- How to Submit Post Via cURL & PHP
- Custom search for custom post meta with pre_get_posts interferes with WP search
- How to get all posts except for one post from a certain custom post type?
- count_many_users_posts except current logged in user?
- How can I show a custom post type for users in the authors.php file?
- Assigning the same custom meta box to multiple post types
- Blog page showing same content as homepage
- Dynamically add / duplicate custom meta in custom post types
- WordPress if in term*
- How Can I Set the Post Author of a Post I Just Created With PHP?
- WordPress Orderby Numeric Value Not Working
- Setting posts per page in query_posts