In X we were able to change the template to add a sidebar/widget to the left side of the main shop page. How can we do this in X Pro? I have attached an example.
Thanks
In X we were able to change the template to add a sidebar/widget to the left side of the main shop page. How can we do this in X Pro? I have attached an example.
Thanks
Hi,
It should be the same in PRO, you can try adding this in your child theme’s functions.php
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 ( x_is_shop() ){
$layout = 'sidebar-content';
}
return $layout;
}
Thanks. I’ll let you know if we have any further issues with it.
Just as an aside, it was really convenient in X. We could simply select the template by editing the shop page itself in Wordpress and selecting the template that page should use.
Hello There,
You’re always welcome!
As stated it is the same in PRO. In terms of structure, the only difference is the header and footer builder and on other part. See this too. For the content area, page template works the same. On Theme Options > Layout and Design > Content Layout: Choose Sidebar Left, Content Right. Then set page template layout on page level. Try it without the code and it will still show shop sidebar.
Lely, in Theme Options we’ve set the Layout and Design to Sidebar Left, Content Right. But we’re unable to make any changes to the WooCommerce Shop page. When I click “Edit in Pro” on the “Shop” page I eventually get an “A conflict on the front end of your site has prevented the preview from loading.” error.
Hi,
Please note that when you set your page to be your shop page, it is no longer editable in cornerstone.
It will be automatically populated by your products.
You can change your Shop layout under PRO > Launch > Theme Options > Wocommerce > Shop