Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1277255
    RPronk
    Participant

    Hello, currently we are building five site’s and five more are on the way for our clients. We are very much in doubt in using sidebars on blog articles. For now I would like to know the easiest way to switch the sidebar on the blog page on or off and the easiest way to switch of the side bare on all blog articles. Since we are in experimental phase we might want to turn them back on, but for now I like to turn them off

    Thanks for your help

    Ronald

    ps this is one of the sites: http://knipt.newfishdev.nl/

    #1277344
    Paul R
    Moderator

    Hi Ronald,

    You can add this in your child theme’s functions.php file.

    
    function blog_index_sidebar($contents) {
        /* Blog page layout */
      if ( is_home() ) {
        $contents = 'content-sidebar';
      }
      /* Blog articles layout */
      if ( is_singular('post') ) {
        $contents = 'content-sidebar';
      }
      
      return $contents;
    }
    
    add_filter('x_option_x_layout_content', 'blog_index_sidebar');
    

    You may change $contents to full-width, content-sidebar or sidebar-content

    Hope that helps.

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