Reputation: 3025
I have the following blog post index page. It loads a featured image before the text of the post.
On the post itself - I would like for the featured image to not load. I believe this involves editing this content.php file (attached here) but I cannot figure out how to do it such that the image loads only on the index page and not on the post page. Any help would be appreciated.
Upvotes: 0
Views: 123
Reputation: 3028
You have to find all the occurrences of function the_post_thumbnail
and remove them.
Interesting files are:
Also check for get_the_post_thumbnail
Upvotes: 0
Reputation: 2928
Add the below code in place of the_post_thumbnail( 'serene-featured-image' ); at line no 24
Replace line no 24 with below code:
<?php
if ( ! is_single() ) :
the_post_thumbnail( 'serene-featured-image' );
endif;
?>
Upvotes: 1
Reputation: 3622
Comment out this code in your single.php
(Deatil page of the Blog post)
<div class="main-image<?php if ( '' == get_the_post_thumbnail() && 'video' === get_post_format() ) echo ' et_video_only'; ?>">
<?php if ( 'video' === get_post_format() && false !== ( $first_video = et_get_first_video() ) ) : ?>
<div class="et-video-container">
<?php echo $first_video; ?>
</div>
<?php endif; ?>
<?php if ( ! is_single() || ! 'video' !== get_post_format() ) : ?>
<a href="<?php the_permalink(); ?>" class="et-main-image-link">
<?php endif; ?>
<?php the_post_thumbnail( 'serene-featured-image' ); ?>
<?php serene_post_meta_info(); ?>
<?php if ( isset( $first_video ) && $first_video ) : ?>
<span class="et-play-video"></span>
<?php endif; ?>
<?php if ( ! is_single() || ! 'video' !== get_post_format() ) : ?>
</a>
<?php endif; ?>
</div> <!-- .main-image -->
Upvotes: 0