Tagged: x
-
AuthorPosts
-
October 3, 2016 at 11:15 am #1200640
SimonParticipantHi X-Team !
I try to display left sidebar on the single product page.
I have find this and it’s work find :
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', 'content-sidebar' ); 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_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() || x_is_product() ) { $opt = x_get_option( 'x_woocommerce_shop_layout_content', 'sidebar' ); $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt; } else { $opt = x_get_option( 'x_archive_layout', 'sidebar' ); $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt; } } 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; } return $layout; } endif;I have also add this for display the sidebar on the left.
But my home-page is totaly unorganized@media only screen and (min-width: 980px) { .x-main { float: right !important; } .x-sidebar { float: left !important; } }I just want the same sidebar that products page on the single product.
Just want a sidebar on left of my single product page.
I need some help… 🙂October 3, 2016 at 11:21 am #1200652
SimonParticipantThis reply has been marked as private.October 3, 2016 at 2:07 pm #1200873
Nabeel AModeratorHi there,
Thanks for writing in! Please add the following code in your Customizer via Appearance > Customize > Custom > Edit Global CSS:
.x-sidebar { float: left !important; } .x-main { float: right !important; }On your homepage you don’t have a sidebar that’s why the above code doesn’t work on your homepage.
Let us know how this goes!
October 3, 2016 at 2:24 pm #1200889
SimonParticipantHi Nabeel,
Maybe I do not have a sidebar on the home page but these css totally deconstruct my homepage.
By blowing my background and with the float right of my content. Css conflict i think.Simon
October 3, 2016 at 2:26 pm #1200892
SimonParticipantscreenshot
October 3, 2016 at 5:09 pm #1201096
Nabeel AModeratorHi again,
You can replace the previous code with this one:
@media screen and (min-width: 980px){ body:not(.home) .x-main { float: right !important; } body:not(.home) .x-sidebar { float: left !important; } }Hope this helps!
October 4, 2016 at 2:18 am #1201587
SimonParticipantNabeel,
You’r the best ! 🙂
Big thanks !
October 4, 2016 at 3:43 am #1201674
FriechModeratorWe’re delighted to assist you with this.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1200640 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
