Category Archives: WordPress

Hiding Featured Images in WordPress Blog Posts

My wife recently asked me if she could hide the featured images in her blog posts.  She wanted the photos displayed on her home page and post listings, but not on the actual page for the blog post – She wanted to actually insert the image to her post at some point into the post:

I did some Googling, and found that most themes implement a “single.php” file.  In this file is a definition for how the individual blog posts render:

<?php if (is_single()) : ?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<?php the_post_thumbnail(‘featured’); ?>
<div id=”post-content”>
<?php the_title(‘<h1 id=”post-title”>’, ‘</h1>’); ?>

Of interest to me was the line

<?php the_post_thumbnail(‘featured’); ?>

Which I simply commented out:

<?php #the_post_thumbnail(‘featured’); ?>

And now, the featured image is not displayed at the top of the post, and she is free to insert the image anywhere she wishes:

 

So, with that, you should check out her blog: Anna’s Alcove