View Post text on Ethos post featured image rollover

Hi guys,

I’ve searched all over for this but I can’t find exactly what I’m after. In ethos stack when I have posts in the blog page with a featured image, rolling over them shows ‘View Post’ which I’d like to change. But I can’t find that in a template?

Any chance you could point me in the right direction please?
Thanks,
Mark

Hi Mark,

It’s one of the theme strings and you can change it by following any of the translation methods described here, or simply add this snippet to functions.php file in your child theme file:

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>
          <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

  }

Make sure to change “View Post” in the snippet above to anything you like. If you don’t have a child theme configured, then please follow this guide:

Thanks.

1 Like

Perfect, thank you!

You’re most welcome!

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