Hello There,
The code should have work to display the background image. The problem is because you have Endurance Cache enabled and this is one big reason why the changes can not be seen right away. I would recommend that you disable caching first. Caching are best to turn on only when you’ve finished building the site. To do that, please go to Settings > General
and scroll to the bottom of the page. You will find Endurance Cache option.
To change the look of your portfolio page the same as the Sold Portfolio page layout, we need to modify some elements for the portfolio page. Because what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
After the child theme is set up, please add the following code in your child theme’s functions.php file
// Custm Entry Cover
// =============================================================================
if ( ! function_exists( 'x_ethos_entry_cover' ) ) :
function x_ethos_entry_cover( $location ) {
if ( $location == 'main-content' ) { ?>
<?php if ( x_is_portfolio() ) : ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="h-custom-headline h4"><span><?php x_the_alternate_title(); ?></span></h2>
<a class="entry-cover" href="<?php the_permalink(); ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>"></a>
</article>
<?php else : ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a class="entry-cover" href="<?php the_permalink(); ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>">
<h2 class="h-entry-cover"><span><?php x_the_alternate_title(); ?></span></h2>
</a>
</article>
<?php endif; ?>
<?php } elseif ( $location == 'post-carousel' ) { ?>
<?php GLOBAL $post_carousel_entry_id; ?>
<article <?php post_class(); ?>>
<a class="entry-cover" href="<?php the_permalink(); ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>">
<h2 class="h-entry-cover"><span><?php ( $post_carousel_entry_id == get_the_ID() ) ? the_title() : x_the_alternate_title(); ?></span></h2>
<div class="x-post-carousel-meta">
<span class="entry-cover-author"><?php echo get_the_author(); ?></span>
<span class="entry-cover-categories"><?php echo x_ethos_post_categories(); ?></span>
<span class="entry-cover-date"><?php echo get_the_date( 'F j, Y' ); ?></span>
</div>
</a>
</article>
<?php }
}
endif;
// =============================================================================
Hope this helps. Please let us know how it goes.