Tagged: x
-
AuthorPosts
-
December 11, 2016 at 2:24 pm #1289160
qualalbatrozParticipantHi 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é
December 11, 2016 at 6:54 pm #1289404
RadModeratorHi 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.
December 12, 2016 at 3:50 pm #1290492
qualalbatrozParticipantDear 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/BCU6HBjJvNUThe edited portfolio item of the video is here:
http://qualalbatroz.pt/arquivo/a-locomotiva/Thanks for your help!
Best
José
December 12, 2016 at 6:45 pm #1290676
NicoModeratorHi 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.
December 13, 2016 at 6:03 am #1291173
qualalbatrozParticipantDear 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é
December 13, 2016 at 7:17 am #1291247
Paul RModeratorHi 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 credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
December 14, 2016 at 4:50 pm #1293426
qualalbatrozParticipantThis reply has been marked as private.December 14, 2016 at 10:35 pm #1293786
LelyModeratorHello 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.
December 16, 2016 at 2:36 pm #1295952
qualalbatrozParticipantDear 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é
December 16, 2016 at 5:34 pm #1296130
FriechModeratorCool, please feel free to get in touch with us regarding any further queries about the X|Theme and Cornerstone.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1289160 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
