Disable featured image in a post?

March 2014 WordPress Theme
GK User
Tue Aug 19, 2014 9:31 am
How can I disable featured image in a post (not in a category page)?
User avatar
Senior Boarder

GK User
Tue Aug 19, 2014 10:19 am
When you are editing your post, on the right column you should have posta additional params metabox - here you can enable/disable featured images and other post elements.

If you want to do this for all posts globally, you have to edit News2/layouts/content.post.featured.php file and remove the following fragment (the first fragment around line 31):

Code: Select all
      <figure class="featured-image">
         <?php if(is_sticky()) : ?>
         <sup>
            <?php _e( 'Featured', GKTPLNAME ); ?>
         </sup>
         <?php endif; ?>
         
         <?php the_post_thumbnail(); ?>
         
         <?php if(is_single() || is_page()) : ?>
            <?php echo gk_post_thumbnail_caption(); ?>
         <?php endif; ?>
      </figure>
User avatar
Moderator

GK User
Tue Aug 19, 2014 10:50 am
When I disable featured images in a metabox, it's also disable featured images in a category page! I need to disable ONLY in a post page!?
User avatar
Senior Boarder

GK User
Tue Aug 19, 2014 1:26 pm
You can do it using my second solution above - with News2/layouts/content.post.featured.php file.
User avatar
Moderator

GK User
Tue Aug 19, 2014 3:11 pm
Not working!

I think we need to add а code to the category page... Cause, I need to leave the featured image on the category page when I disable it in additional params metabox! :-)
User avatar
Senior Boarder

GK User
Wed Aug 20, 2014 6:49 am
I've edited your News2/layouts/content.post.featured.php file as mention above and please check your website now - featured image is visible only on category pages.
User avatar
Moderator

GK User
Thu Aug 21, 2014 7:24 am
Thanks Piotr, you you are the best :D
User avatar
Senior Boarder

GK User
Wed Feb 03, 2016 3:15 am
Hi Piotr,
I tried your solution and it works, but I would like to hide or show the featured image into the article when I decide.
(Post additional params > show featured image > enabled/disabled)

I want to hide the featured image into the article, to show it into the category page, but not for all the posts, only for some.

Is it possible? thanks
User avatar
Fresh Boarder

Joshua M
Wed Feb 03, 2016 9:16 am
Hi,
@fedekika it's possible, but requires much more modifications in theme files - unfortunately it's beyond our technical support.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.