Custom excerpt added to ethos blog index featured image post layout is faded

I added the excerpt to my blog index with index featured image post layout in the functions.php file and I adjusted the CSS to reflect the font styling for 17pt and white color. What I’m having trouble with is it appears that the excerpt is behind a semi-transparent overlay so I can’t see the words very well. I’d like them to be on the top layer if possible.

The code in the PHP file is as follows:

<?php

// =============================================================================
// FUNCTIONS.PHP
// -----------------------------------------------------------------------------
// Overwrite or add your own custom functions to Pro in this file.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Enqueue Parent Stylesheet
//   02. Additional Functions
// =============================================================================

// Enqueue Parent Stylesheet
// =============================================================================

add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );



// Additional Functions
// =============================================================================

// Featured Index Content
// =============================================================================

if ( ! function_exists( 'x_ethos_featured_index' ) ) :
  function x_ethos_featured_index() {

    $entry_id                    = get_the_ID();
    $index_featured_layout       = get_post_meta( $entry_id, '_x_ethos_index_featured_post_layout', true );
    $index_featured_size         = get_post_meta( $entry_id, '_x_ethos_index_featured_post_size', true );
    $index_featured_layout_class = ( $index_featured_layout == 'on' ) ? ' featured' : '';
    $index_featured_size_class   = ( $index_featured_layout == 'on' ) ? ' ' . strtolower( $index_featured_size ) : '';
    $is_index_featured_layout    = $index_featured_layout == 'on' && ! is_single();

    ?>

      <a href="<?php the_permalink(); ?>" class="entry-thumb<?php echo $index_featured_layout_class; echo $index_featured_size_class; ?>" style="<?php echo x_ethos_entry_cover_background_image_style(); ?>">
        <?php if ( $is_index_featured_layout ) : ?>
          <span class="featured-meta"><?php echo x_ethos_post_categories(); ?> / <?php echo get_the_date( 'F j, Y' ); ?></span>
          <h2 class="h-featured"><span><?php x_the_alternate_title(); ?></span></h2>
           <div class="excerpt"><?php the_excerpt(); ?></div>
          <span class="featured-view"><?php _e( 'View Post', '__x__' ); ?></span>
        <?php else : ?>
          <span class="view"><?php _e( 'View Post', '__x__' ); ?></span>
        <?php endif; ?>
      </a>

    <?php

  }
endif;

And the custom global CSS is

 a .excerpt {
color: #ffffff;
font-size: 18px;
}

Hello @garchambault,

Thanks for reaching out to us. To get this issue resolved, please update your custom CSS into this:

a .excerpt {
    color: #ffffff;
    font-size: 18px;
    position: relative;
    z-index: 10;
}

You need to change the z-index because an overlay is covering the item that gives a semi transparent effect. Be advice that this code serves as an example. You will have to maintain this code whenever there are theme and plugin updates in your site to make sure that the custom CSS code is still working.

Best Regards.

So this worked for the text but now the featured image doesn’t appear at all.

will I need to update the CSS code even though I’m using a child theme?

never mind, I went back in and it updated the images now. Thanks for your help.

You’re welcome.
If you need anything else we can help you with, don’t hesitate to open another thread.

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