Full Width post by Category

Hi!

I found this post: https://theme.co/apex/forum/t/show-hide-sidebar-by-post-category/16986

I am trying to hide the sidebar and make the post full width just for my podcasts. When I go to Chrome and right click inspect. It does not show the category.

Also, how do I hide “The Blog” or change it to “DDT Podcast” on the top of my podcasts posts?

Thank you so much!

Hello @kodifletcher,

Thanks for asking. :slight_smile:

You can change The Blog from X > Launch > Options > Integrity (Stack) > Blog Options > Blog Title. https://screencast.com/t/iNQ5dq6fJ

Regarding the first question, can you please share website URL for us to take a closer look?

Thanks.

I’ll attach it to the secure note.

Hi,

To be able to distinguish what category your posts belong to, kindly add the code below in your child theme

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->category_nicename;
      }
    }
    // return the $classes array
    return $classes;
  }

After that you can add this in Theme Options > CSS

  • Assuming your posts are set in podcasts category

.podcasts .x-sidebar {
   display:none;
}

.podcasts .x-main {
   width:100%;
}

Hope that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.