Sidebar do not appear in portfolio item

Hi,
I follows the tips on this forum but sidebar do not appear in portfolio item:
https://molise.farm/wp/?x-portfolio=mariantonietta

I just will love sidebar in all pages. Any tips?

Many thanks! :slight_smile:

Hi @thomas9999,

Can you clarify which tip you followed? Did you apply some customization? If yes, please share the code you have added to achieve sidebar.

By default we can set sidebar in Theme Options > Layout and Design > Content Layout.

Can you clarify the reason why you didn’t choose to set select sidebar for content on setttings?

Hi @lely ,
I did set sidebar in Theme Options > Layout and Design > Content Layout.
I also followed this: https://theme.co/apex/forum/t/portfolio-customizations-sidebar-for-integrity/30959/4

I created a file wp-single-x-portfolio.php in wp-content/themes/x-child/framework/views/integrity

and added the code to the file funcion.php.

Afer this the sidebar has appaered only here: https://molise.farm/wp/?page_id=111
but not in the single porfolio page.

Many thanks! :slight_smile:

Hello @thomas9999,

Please make sure that your wp-single-x-portfolio.php file has the sidebar <?php get_sidebar(); ?> statement.

<?php

// =============================================================================
// VIEWS/INTEGRITY/WP-SINGLE-X-PORTFOLIO.PHP
// -----------------------------------------------------------------------------
// Single portfolio post output for Integrity.
// =============================================================================

get_header();

?>

  <div class="x-container max width offset">
    <div class="<?php x_main_content_class(); ?>" 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>


    <?php get_sidebar(); ?>
    
  </div>

<?php get_footer(); ?>

We would love to know if this has worked for you. Thank you.

I tried to insert the code you just suggested to me and the sidebar disappears: https://molise.farm/wp/?x-portfolio=rita-antonella

the code I previously had was this:

<?php

// =============================================================================
// VIEWS/INTEGRITY/WP-SINGLE-X-PORTFOLIO.PHP
// -----------------------------------------------------------------------------
// Single portfolio post output for Integrity.
// =============================================================================

get_header();

?>

  <div class="x-container max width offset">
    <div class="x-main leftl" 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>
    <?php get_sidebar(); ?>
  </div>

<?php get_footer(); ?>

Hello @thomas9999,

To better assist you with your issue, kindly provide us access to your site so that we can check your settings. Please create a secure note with the following info:
– Link to your site
– WordPress Admin username / password

To know how to create a secure note, please check this out: https://theme.co/apex/forum/t/how-to-get-support/288

Regards.

1 Like

Hello @thomas9999,

I have updated the code into this:

<?php

// =============================================================================
// VIEWS/INTEGRITY/WP-SINGLE-X-PORTFOLIO.PHP
// -----------------------------------------------------------------------------
// Single portfolio post output for Integrity.
// =============================================================================



get_header();

?>

  <div class="x-container max width offset">
    <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="x-sidebar right" role="complementary">
	    <?php if ( get_option( 'ups_sidebars' ) != array() ) : ?>
	      <?php dynamic_sidebar( apply_filters( 'ups_sidebar', 'sidebar-main' ) ); ?>
	    <?php else : ?>
	      <?php dynamic_sidebar( 'sidebar-main' ); ?>
	    <?php endif; ?>
	</aside>

  </div>

<?php get_footer(); ?>

The sidebar should be displaying now. Please check your site.

1 Like

Yes, it works!
Just the last think: on mobile the view it’s not perfect, there is a way to expand the space on the left?
like the blog page: https://molise.farm/wp/?p=50

Many thanks!

Hello @thomas9999,

I am not sure which part you are referring to. When I check the page on mobile device screen, I am seeing this:

Please clarify.

I was talking about the portfolio page: https://molise.farm/wp/?x-portfolio=mariantonietta
Sorry now I just refreshed the page and it’s ok :thumbsup:

There is only one problem, from Desktop there is a little space on the right of the text that would be better eliminated, so that the page structure becomes the same as blog pages. I attach an image.

Many thanks!

Hi Thomas,

That should be fixed by adding this CSS in X > Theme Options > CSS:

.x-portfolio .entry-info {
    width: 100% !important;
}

Hope this helps.

1 Like

Works perfect, many thanks! :smile:

You’re most welcome. :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.