Hello Matt,
Thanks for the very informative loom video.
-
First, please update the X theme to the latest version. X 6.5.5 is now available in automatic updates! This release contains fixes for several issues so be sure to check out the changelog (https://theme.co/changelog/). Please do update to the latest version. After doing the updates, always remember to clear all caches when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.
-
Second, please revert or remove any changes you may have added as suggested in the thread given by Friech. We just need to start over since you want the sidebar to display underneath the extra
element area.
-
And lastly, assuming you have your child theme active and ready, please follow these steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file
<?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 // Here is the sidebar ?>
<?php get_sidebar(); ?>
</div>
<?php endif; ?>
</div>
</article>
3] Save the file named as content-portfolio.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/x-child/framework/views/renew/
5] If the sidebar still does not display, please add the following code in your child theme’s functions.php file
// Custom Portfolio Layout
// =============================================================================
if ( ! function_exists( 'x_get_content_layout' ) ) :
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_item() ) {
$layout = 'content-sidebar';
} 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;
}
return $layout;
}
endif;
// =============================================================================
We would love to know if this has worked for you. Thank you.