Hi. I an trying to ally the css to one of my CPT’s to achieve a full width layout, following the https://theme.co/apex/forum/t/full-width-post-by-category/19913/4 kb. Here is what I have done thus far
- Added css to Customizer per kb, using my CPT post type name/slug of storefront
.storefront .x-sidebar {
display:none;
}
.storefront .x-main {
width:100%;
}
- Added following to child function.php
add_filter(‘body_class’,‘add_category_to_single’);
function add_category_to_single($classes) {
if (is_single() ) {
global $post;
foreach((get_the_category($post->ID)) as $category) {
// add category slug to the $classes array
$classes[] = $category->storefront; storefront_categories
}
}
// return the $classes array
return $classes;
}
This approach hasn’t worked - storefront post --> https://mysalus.org/storefront/hg-wellness/ is still showing sidbar. Perhaps I am not uderstanding the CPT "category application (vs page slug)? so I tried the CPT category of storefront_categories instead of post slug above but it still did not work for me.
Thoughts? Thanks.