Tagged: x
-
AuthorPosts
-
July 11, 2016 at 6:26 pm #1082266
LeannaParticipantHi, my site is Fullwidth but I need a sidebar or widget area aligned right in the main Blog page. I have tried this code in child theme functions but no change:
function x_get_content_layout() {
$content_layout = x_get_option( ‘x_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’ ) ) {
//$layout = ‘content-sidebar’;
$opt = x_get_option( ‘x_archive_layout’, ‘sidebar’ );
$layout = ( $opt == ‘sidebar’ ) ? $content_layout : $opt;
} 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’, ‘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_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;
}return $layout;
}
July 11, 2016 at 6:27 pm #1082268
LeannaParticipantThis reply has been marked as private.July 12, 2016 at 2:13 am #1082716
ChristopherModeratorHi there,
Instead of adding code to your child theme, please select one of layouts with sidebar under Customize -> Layout and design. Please select blank template for pages that you want to hide sidebar.
Hope it helps.
July 12, 2016 at 4:15 pm #1083787
LeannaParticipantGreat job, thank you!
July 12, 2016 at 11:28 pm #1084222
Prasant RaiModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1082266 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
