Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1317583
    Lyser
    Participant

    Hello,
    I would like to have a widget sidebar on the right of the portfolio item, how can i do that ?

    #1317631
    Rupok
    Member

    Hi 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

    #1317743
    Lyser
    Participant

    Mmm 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 ?

    #1317815
    Lyser
    Participant

    Ok it seems to work but not completly u can see the portfolio page here, it’s ok :
    portfolio page

    But when i click on the portfolio item, here’s what i have :
    portfolio item

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

    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' ) ) {
            $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(); ?>
    #1317931
    Jade
    Moderator

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

    #1318025
    Lyser
    Participant
    #1318436
    Paul R
    Moderator

    Hi,

    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

    #1318758
    Lyser
    Participant

    That’s perfect, Thx a lot !

    #1318934
    Prasant Rai
    Moderator

    You are most welcome. 🙂

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