Add more content to sidebar (Renew)

Hi all,

I want to add more content/widgets to the single post portfolio sidebar. Like categories and images. But can’t find a solution for this. Can somebody help me out?

Example of my current sidebar information:
Imgur

Thanks and have a great weekend!

Mark

Hi Mark,

Thanks for reaching out.

That’s not a sidebar but just special area specific to the portfolio item layout. And they aren’t widgets, they are functions provided by the theme. Example,

You’ll have to convert that area as the sidebar in order to add more widgets by adding <?php get_sidebar(); ?> Example,

<div class="entry-extra">
        <?php x_portfolio_item_tags(); ?>
        <?php x_portfolio_item_project_link(); ?>
        <?php x_portfolio_item_social(); ?>
       <?php get_sidebar(); ?>
</div>

For that, please check this to give you the idea on how to edit templates https://theme.co/apex/forum/t/how-to-upload-xtheme-to-child-theme/43246/2

And you’ll be working on file \framework\views\renew\content-portfolio.php of your child theme, the complete code is

<?php

// =============================================================================
// VIEWS/RENEW/CONTENT-PORTFOLIO.PHP
// -----------------------------------------------------------------------------
// Portfolio post output for Renew.
// =============================================================================

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

  <?php if ( ! x_is_portfolio_item() ) : ?>

    <div class="entry-featured">
      <?php x_portfolio_item_featured_content(); ?>
      <div class="entry-cover">
        <div class="entry-cover-content">
          <span><?php echo get_post_meta( get_the_ID(), '_x_portfolio_media', true ); ?></span>
          <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>
          <span><?php echo get_the_date( 'm.d.y' ); ?></span>
        </div>
      </div>
    </div>

  <?php endif; ?>

  <div class="entry-wrap cf">

    <?php if ( is_singular() ) : ?>

      <div class="entry-info">
        <div class="entry-featured">
          <?php x_featured_portfolio( 'cropped' ); ?>
        </div>
        <header class="entry-header">
          <h1 class="entry-title entry-title-portfolio"><?php the_title(); ?></h1>
          <?php x_renew_entry_meta(); ?>
        </header>
        <?php x_get_view( 'global', '_content', 'the-content' ); ?>
      </div>
      <div class="entry-extra">
        <?php x_portfolio_item_tags(); ?>
        <?php x_portfolio_item_project_link(); ?>
        <?php x_portfolio_item_social(); ?>
        <?php get_sidebar(); ?>
      </div>

    <?php endif; ?>

  </div>
</article>

Once done, you can then go to Admin > Appearance > Widgets and add widgets to the main sidebar.

Thanks!

1 Like

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