Support » Fixing WordPress » Remove Featured Image for the_content not the_excerpt

  • Hi,

    I have set up my loop.php to display the most recent post in full then all other posts as an excerpt using some conditional code. This works fine but I need to disable the featured image for the latest post showing the_ content as it looks messy showing the thumb as well as the first image http://www.nebulasdesign.com/dgr/latest-news.

    Any help would be good.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Christine Rondeau

    (@crondeau)

    Volunteer Forum Moderator

    Can you share your loop.php using pastebin?

    Hi may apologies should have done this http://pastebin.com/RK9FYwwS.

    Thanks.

    Moderator keesiemeijer

    (@keesiemeijer)

    Try checking if the counter is greater than 1 and put your featured image code inside that conditional: http://pastebin.com/1iMZzxdM

    Thanks for the reply and the code.

    I did have a play around with the feature image code but couldn’t work out how to add this into the conditional, it kept on breaking the page. Can you let me know how I would insert it?

    Moderator keesiemeijer

    (@keesiemeijer)

    As in the pastebin I posted put the featured image code:

    <div class="blog-thumb"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('featured-post-thumbnail'); ?></a></div>

    in a conditional like this:

    <?php if ($counter > 1) : ?>
    <!-- featured image code here -->
    <?php endif; ?>

    end result:

    <?php if ($counter > 1) : ?>
    
    <div class="blog-thumb"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('featured-post-thumbnail'); ?></a></div>
    
    <?php endif; ?>

    Sorry I missed that in your code thanks very much for your help this works a treat!

    Moderator keesiemeijer

    (@keesiemeijer)

    No problem 🙂
    I’m glad you’ve got it resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove Featured Image for the_content not the_excerpt’ is closed to new replies.