How Do I Get Rid Of Featured Image Within The Post?

WordPress theme dedicated to start-up websites with amazing CSS3 animated icons, price tables and parallax effect background.
GK User
Tue Aug 06, 2013 2:13 pm
I want to have the option to not show the featured image within the post. How do I do this?

Basically I just want the featured image to be seen when someone is seeing my Blog page. But in each individual post, I don't want it to be seen.

Help is appreciated :)
User avatar
Fresh Boarder

GK User
Tue Aug 06, 2013 2:33 pm
Hi,

In general in the latest version of the theme it is possible to disable the featured image on the single page on the post editor.

If you are using older version and your layouts/content.post.featured.php file contains only this code:

Code: Select all
<?php

/**
 *
 * The template fragment to show post featured image
 *
 **/

// disable direct access to the file   
defined('GAVERN_WP') or die('Access denied');

global $tpl;

?>

<?php if(has_post_thumbnail()) : ?>
<figure class="featured-image">
   <?php the_post_thumbnail(); ?>
</figure>
<?php endif; ?>


you can change:

Code: Select all
<?php if(has_post_thumbnail()) : ?>
<figure class="featured-image">
   <?php the_post_thumbnail(); ?>
</figure>
<?php endif; ?>


to:

Code: Select all
<?php if(has_post_thumbnail() && !is_single()) : ?>
<figure class="featured-image">
   <?php the_post_thumbnail(); ?>
</figure>
<?php endif; ?>
User avatar
Administrator

GK User
Thu Aug 08, 2013 10:58 pm
Worked beautifully, thank you sir :)
User avatar
Fresh Boarder

GK User
Mon Sep 30, 2013 11:04 am
Hi,

I have the opposite question - I want to show a featured image on the contact page. It is enabled and i've set up the image, but it doesn't show. How can I fix this?

Thanks,
Peter
User avatar
Fresh Boarder

GK User
Mon Sep 30, 2013 5:26 pm
In this case you have to add the following code on the template.contact.php file:

Code: Select all
<?php if(has_post_thumbnail()) : ?>
<figure class="featured-image">
   <?php the_post_thumbnail(); ?>
</figure>
<?php endif; ?>
User avatar
Administrator

GK User
Mon Sep 30, 2013 8:16 pm
It works, thanks :)
User avatar
Fresh Boarder


cron