Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1065328
    Houston
    Participant

    In the customizer I have set the site to FULLWIDTH. Is there no way to put a sidebar now in the blog page? If so, please enlighten me.

    #1065343
    Houston
    Participant

    After perusing through the forum, I have concluded that I need to change the layout to “Content left, Sidebar right” and then go and change all the pages to “Fullwidth”. So I tried that but the BLOG page still does not show a sidebar. The BLOG PAGE also has no way of changing the template at all. Am I missing something or is there a better way?

    Many thanks,
    Houston

    #1065385
    Houston
    Participant

    Layout and Design is set to Content left, Sidebar right

    Blog is set to use global content layout

    I cant get these uploads to load the correct image. Arghhhhhhhhhh

    So here.

    http://grab.by/R9W8
    http://grab.by/R9Wc

    #1065426
    Nabeel A
    Moderator

    Hi there,

    If you’re using “Content left, Sidebar right” then there should be sidebar on your blog page. Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1065460
    Houston
    Participant
    This reply has been marked as private.
    #1066018
    Friech
    Moderator

    Hi There,

    Thanks for the credentials, but I cant seem to access the admin dashboard. Please confirm


    screenshot

    Thanks.

    #1066744
    Houston
    Participant
    This reply has been marked as private.
    #1067134
    Darshana
    Moderator

    Hi there,

    Please try switching to the parent theme and see if that renders your sidebar. If so, you will need to check your child theme templates and customizations added which causes this issue.

    Thanks!

    #1067459
    Houston
    Participant

    Yes, that made it appear. So I started investigating and found that I used this code in the functions.php file to create a sidebar on the Products page of woocommerce. I need that. So would you happen to know how I can make this work?
    http://grab.by/Rc1K

    Here is the code that is in the functions.php in the child-theme.

    //customsidebar for the products page
    if ( ! function_exists( 'x_get_content_layout' ) ) :
      function x_get_content_layout() {
    
        $stack          = x_get_stack();
        $content_layout = x_get_option( 'x_' . $stack . '_layout_content', 'sidebar-content' );
    
    //    if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            $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_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) {
              $layout = 'sidebar-content';
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $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', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
    //    } else {
    //      $layout = $content_layout;
    //    }
    
          if ( 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';
          }
    
        return $layout;
    
      }
    endif;
    
    add_filter( 'ups_sidebar', function ( $default_sidebar ) {
    
      $sidebars = get_option( 'ups_sidebars' );
    
      foreach ( $sidebars as $id => $sidebar ) {
        if (  x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) {
          if ( array_key_exists( 'index-shop', $sidebar ) && $sidebar['index-shop'] == 'on' ) {
            return $id;
          }
        }
      }
    
      return $default_sidebar;
    
    }, 9999 );

    Many thanks,
    Houston

    #1067933
    Rue Nel
    Moderator

    Hello Houston,

    Please have your code updated and use this instead to have a sidebar in your blog index and on single post;

    //customsidebar for the products page
    if ( ! function_exists( 'x_get_content_layout' ) ) :
      function x_get_content_layout() {
    
        $stack          = x_get_stack();
        $content_layout = x_get_option( 'x_' . $stack . '_layout_content', 'sidebar-content' );
    
    //    if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            //$layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            $layout = $content_layout;
    
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            //$layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
            $layout = $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_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) {
              $layout = 'sidebar-content';
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $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', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
    //    } else {
    //      $layout = $content_layout;
    //    }
    
          if ( 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';
          }
    
        return $layout;
    
      }
    endif;

    Please let us know if this works out for you.

    #1068483
    Houston
    Participant

    Thank you very much for this.

    But, I put this code in replacing what was there and still no sidebar.

    http://splitlightdesigns.com/askari-stage/blog/

    Many thanks,
    Houston

    #1068731
    Houston
    Participant
    This reply has been marked as private.
    #1068972
    Rad
    Moderator

    Hi there,

    Please change it into this,

     function x_get_content_layout() {
    
        $stack          = x_get_stack();
        $content_layout = x_get_option( 'x_' . $stack . '_layout_content', 'sidebar-content' );
    
    //    if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            //$layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            $layout = 'sidebar-content';
    
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            //$layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
            $layout = $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_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) {
              $layout = 'sidebar-content';
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $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', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
    //    } else {
    //      $layout = $content_layout;
    //    }
    
          if ( 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';
          }
    
        return $layout;
    
      }
    

    Thanks!

    #1068980
    Houston
    Participant

    Excellent, that works. One last item, it still does not show on the POST page, just the index page. 🙁

    Also, this code prevents the sidebar that shows up in the STORE to revert to the blog sidebar when viewing products.

    #1069251
    Rue Nel
    Moderator

    Hello There,

    Sorry if it didn’t quite resolve the issue. There is a missing piece of code. Please update it and use this instead:

     function x_get_content_layout() {
    
        $stack          = x_get_stack();
        $content_layout = x_get_option( 'x_' . $stack . '_layout_content', 'sidebar-content' );
    
    //    if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            //$layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            $layout = 'sidebar-content';
    
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            //$layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
            $layout = 'sidebar-content';
          } 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_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) {
              $layout = 'sidebar-content';
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $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', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( x_is_buddypress() ) {
            $opt    = x_get_option( 'x_buddypress_layout_content', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
    //    } else {
    //      $layout = $content_layout;
    //    }
    
          if ( 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';
          }
    
        return $layout;
    
      }

    Please let us know if this works out for you.

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