Tagged: x
-
AuthorPosts
-
January 5, 2017 at 11:55 am #1317583
LyserParticipantHello,
I would like to have a widget sidebar on the right of the portfolio item, how can i do that ?January 5, 2017 at 12:15 pm #1317631
RupokMemberHi there,
Thanks for writing in! The portfolio items are designed to not have a sidebar. If you still want then you can do it with Child Theme. Kindly follow this guide – https://community.theme.co/forums/topic/how-do-i-create-a-portfolio-item-sidebar/#post-125472
January 5, 2017 at 1:50 pm #1317743
LyserParticipantMmm i’ve followed each step but i don’t see any change, it should have a new layout model named “sidebar-content” to choose in the right of the page instead of layout-portfolio no ?
January 5, 2017 at 2:34 pm #1317815
LyserParticipantOk it seems to work but not completly u can see the portfolio page here, it’s ok :
But when i click on the portfolio item, here’s what i have :
Widget is here but there is no more container in the page and also no space between center infos and widgets (and also the top), but there is a space on the right of widget…
Here is what i’ve changed :
Added in child theme function.phpfunction 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' ) ) { $meta = get_post_meta( get_the_ID(), '_x_post_layout', true ); $layout = ( $meta == 'on' ) ? 'full-width' : $content_layout; } elseif ( x_is_portfolio_item() ) { $layout = 'sidebar-content'; /* LAYOUT FOR SINGLE PORTFOLIO PAGE */ } 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; }and file wp-single-x-portfolio.php created in x-child/framework/views/integrity/ with the code :
<?php // ============================================================================= // VIEWS/INTEGRITY/WP-SINGLE-X-PORTFOLIO.PHP // ----------------------------------------------------------------------------- // Single portfolio post output for Integrity. // ============================================================================= ?> <?php get_header(); ?> <div class="x-container-fluid max width offset cf"> <div class="x-main left" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php x_get_view( 'integrity', 'content', 'portfolio' ); ?> <?php x_get_view( 'global', '_comments-template' ); ?> <?php endwhile; ?> </div> <aside class="<?php x_sidebar_class(); ?>" role="complementary"> <?php dynamic_sidebar( 'sidebar-main' ); ?> </aside> </div> <?php get_footer(); ?>January 5, 2017 at 4:40 pm #1317931
JadeModeratorHi there,
To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
January 5, 2017 at 6:02 pm #1318025
LyserParticipantokay => http://www.lyser.fr/testwp/
January 6, 2017 at 12:05 am #1318436
Paul RModeratorHi,
Please remove the codes you have added in your child theme then create file content-portfolio.php in wp-content/themes\x-child/framework/views/integrity and copy the code below into that file.
<?php // ============================================================================= // VIEWS/INTEGRITY/CONTENT-PORTFOLIO.PHP // ----------------------------------------------------------------------------- // Portfolio post output for Integrity. // ============================================================================= $archive_share = x_get_option( 'x_integrity_portfolio_archive_post_sharing_enable' ); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-featured"> <?php x_portfolio_item_featured_content(); ?> </div> <div class="entry-wrap cf"> <?php if ( x_is_portfolio_item() ) : ?> <div class="entry-info"> <header class="entry-header"> <h1 class="entry-title entry-title-portfolio"><?php the_title(); ?></h1> <?php x_integrity_entry_meta(); ?> </header> <?php x_get_view( 'global', '_content', 'the-content' ); ?> <div class="entry-extra"> <?php x_portfolio_item_tags(); ?> <?php x_portfolio_item_project_link(); ?> <?php x_portfolio_item_social(); ?> </div> </div> <aside class="<?php x_sidebar_class(); ?>" role="complementary"> <?php dynamic_sidebar( 'sidebar-main' ); ?> </aside> <?php else : ?> <header class="entry-header"> <h2 class="entry-title entry-title-portfolio"> <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php x_the_alternate_title(); ?></a> </h2> <?php if ( $archive_share == '1' ) : ?> <?php x_portfolio_item_social(); ?> <?php endif; ?> </header> <?php endif; ?> </div> </article>After that, add this in Custom > Edit global CSS
.x-portfolio .entry-extra { margin-top: 30px; float: none; width: 100%; }Hope that helps
January 6, 2017 at 6:53 am #1318758
LyserParticipantThat’s perfect, Thx a lot !
January 6, 2017 at 10:07 am #1318934
Prasant RaiModeratorYou are most welcome. 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1317583 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
