Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1126837
    kateanita
    Participant

    Hello, I already have my homepage designed using the fullwidth option (stack is renew.)

    I want a sidebar on the archive and individual blog pages, but if I select the option to have a sidebar it ruins my homepage. Can I apply the sidebar on the right to the archive and blog pages only?

    Site is http://dev.stapkodesign.com/

    Thanks very much!

    Katie

    #1126958
    Paul R
    Moderator

    Hi Katie,

    Thanks for writing in!

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

    
    function x_get_content_layout() {
    
        $content_layout = x_get_option( 'x_layout_content' );
    
        if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            $layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
          } elseif ( x_is_portfolio_item() ) {
            $layout = 'full-width';
          } elseif ( x_is_portfolio() ) {
            $meta   = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
            $layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
          } elseif ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
            $layout = 'content-sidebar';
          } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
            $layout = 'sidebar-content';
          } elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
            $layout = 'full-width';
          } elseif ( is_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() ) {
              $opt    = x_get_option( 'x_woocommerce_shop_layout_content' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            } else {
              $opt    = x_get_option( 'x_archive_layout' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            }
          } elseif ( x_is_product() ) {
            $layout = 'full-width';
          } elseif ( x_is_bbpress() ) {
            $opt    = x_get_option( 'x_bbpress_layout_content' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
        } else {
          $layout = $content_layout;
        }
    
        if ( is_singular( 'post' ) || is_archive() || is_home() ) {
            $layout = 'content-sidebar';
        }
        return $layout;
    
      }
    

    Hope that helps.

    #1127335
    kateanita
    Participant

    You guys are the best! Thanks so much! Worked perfectly.

    #1127410
    kateanita
    Participant

    Hi – one follow up question – the sidebar on my individual post pages has different content even though I thought I had it setup correctly in the widgets area.

    I have attached screenshots of how my options are setup and it’s correct on the blog archive page, but when you go to individual pages, there are additional widgets in the sidebar: http://dev.stapkodesign.com/a-helpful-podcast-from-valenti-international-find-someone-attractive-and-accomplished-like-you/

    I’m not sure where these additional widgets are coming from – I want it to be the same as the archive page: http://dev.stapkodesign.com/blog/

    Thanks!

    Katie

    #1127411
    kateanita
    Participant

    oops forgot to add attachments!

    #1127415
    kateanita
    Participant

    Nevermind I figured it out! The widgets for the individual blog pages are feeding from the “Main Sidebar”.

    #1127483
    Joao
    Moderator

    Hi There,

    Thanks for letting us know.

    If you need further help please get in touch!

    Thanks

    Joao

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