Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1082266
    Leanna
    Participant

    Hi, 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;

    }

    #1082268
    Leanna
    Participant
    This reply has been marked as private.
    #1082716
    Christopher
    Moderator

    Hi 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.

    #1083787
    Leanna
    Participant

    Great job, thank you!

    #1084222
    Prasant Rai
    Moderator

    You are most welcome. 🙂

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