Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1272489
    Phillip
    Participant

    Hi. Is there any way to disable the sidebar on certain pages in Renew 4?

    #1272638
    Lely
    Moderator

    Hi Philip,

    To help you better, please share the URL of the pages where you want to disable sidebar. There are different ways to do that depending on the page. For example, if it’s a normal page that you have created via Pages > Add new, we can disable sidebar by using Layout-Fullwidth page template. On other pages like blog index page, archive pages or single post page, we need some customization using a child theme to achieve this. Please clarify so we can give you detailed recommendation.

    Cheers!

    #1272714
    Phillip
    Participant

    Well what I’m wanting to do is disable the sidebar for ALL pages. However, I want to display the sidebar on posts.

    #1272730
    Lely
    Moderator

    Hi Phillip,

    In that case, make sure that you have selected FULLWIDTH on Appearance > Customize > Layout and Design > Content Layout: Choose Fullwidth. That will disable sidebar on the entire site. Then we have to add the following code on your child theme’s functions.php file to add sidebar on single post only:

    function single_post_sidebar($contents) {
    
      if ( is_single() ) {
    
        $contents = 'content-sidebar';
    
      }
    
      
    
      return $contents;
    
    }
    
    add_filter('x_option_x_layout_content', 'single_post_sidebar');
    

    Hope this helps.

    #1272747
    Phillip
    Participant

    Ok. So if I apply that code to the functions.php file, I can still create unique sidebars through Appearance > Sidebars as if I had them enabled right?

    #1272766
    Rue Nel
    Moderator

    Hello There,

    The code must be added in your child theme’s functions.php file so that it will not be overwritten when there is an X updates. And yes you can still create sidebars. You should be be assigning the sidebar to the specific posts or group of posts though.

    Please let us know how it goes.

  • <script> jQuery(function($){ $("#no-reply-1272489 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>