Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1289160
    qualalbatroz
    Participant

    Hi there,

    We would like to have two different portefolios in our website (we’re using the integrity stack). For a set of categories the sidebar is really useful, but for others, we would like to have fullwidth portefolio item pages, without the sidebar.

    How could we accomplish this?

    Thanks for the great support!

    José

    #1289404
    Rad
    Moderator

    Hi there,

    Thanks for posting in.

    Please add this code to 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() ) {
            $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_portfolio_item() ) {
            $layout = get_post_meta( get_the_ID(), 'x_layout', true );
            if ( empty( $layout ) ) {
              $layout = 'full-width';
            }
        }
    
        return $layout;
    
      }

    Then edit your portfolio item and add custom field with name x_layout and value of either content-sidebar or sidebar-content. Else, it will default to full-width.

    Hope this helps.

    #1290492
    qualalbatroz
    Participant

    Dear Rad,

    Thanks for the quick answer and help. I followed your instructions, but I couldn’t get a full-width portfolio item page. The sidebar always shows. I’ve recorded a video for you to check:
    https://youtu.be/BCU6HBjJvNU

    The edited portfolio item of the video is here:
    http://qualalbatroz.pt/arquivo/a-locomotiva/

    Thanks for your help!

    Best

    José

    #1290676
    Nico
    Moderator

    Hi There,

    In this case, you need to add it in your X theme child theme Function.

    To setup child theme, https://community.theme.co/kb/how-to-setup-child-themes/

    For customization guide,

    https://community.theme.co/kb/customization-best-practices/

    Hope it helps.

    Let us know how it goes.

    Thanks.

    #1291173
    qualalbatroz
    Participant

    Dear Nico,

    I don’t follow your last suggestion. I am already using a child theme and I added the code to functions.php of my child theme. Could you elaborate on your suggestion?

    Thanks

    José

    #1291247
    Paul R
    Moderator

    Hi Jose,

    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
    – FTP credentials

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

    #1293426
    qualalbatroz
    Participant
    This reply has been marked as private.
    #1293786
    Lely
    Moderator

    Hello José,

    Thank you for the credentials.
    Upon checking, your portfolio is currently fullwidth:http://screencast-o-matic.com/watch/cDlof3Q0Ds
    Are you referring to boxed part in the screenshot? If yes, we can use custom CSS instead. On that specific portfolio item where you want to hide that part, please add hide-sidebar on the Body CSS Class field. Then add the following CSS on Appearance > Customize > Custom > CSS:

    .hide-sidebar .x-portfolio .entry-extra {
        display: none;
    }
    .hide-sidebar .x-portfolio .entry-info {
        width: 100%;
    }

    Hope this helps.

    #1295952
    qualalbatroz
    Participant

    Dear Lely,

    That worked perfectly. That’s exactly what I wanted. I then added the following lines to the CSS customizer to:

    – hide the page title

    .hide-sidebar .entry-header {
    	display: none;
    }

    – hide the featured image

    .hide-sidebar .entry-featured {
        display: none;
    }

    Thanks for the great support!

    Best

    José

    #1296130
    Friech
    Moderator

    Cool, please feel free to get in touch with us regarding any further queries about the X|Theme and Cornerstone.

    Cheers!

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