-3

I found similar questions to it but none was an exact match to my question.

I am using featured image in all my posts. I want to remove featured image on single post view from a single category (Say Video Interview) and not from multiple post view i.e. homepage.

In other words, From Video category I want to show featured image in homepage but when someone clicks on continue reading and is redirected to single post view or full post view then featured image should disappear. I want to put videos in my post without any text. So it would look odd if featured image shows up in single post view.

So, the code needs to be

1.) Category wise

2.) Only removing featured image at single post page

  • 2
    What have you coded so far? Please paste your work to date and detail why it doesn't work. Thanks – Brad Dalton Apr 28 '15 at 12:50
  • Pieter Goosen u have been a disturbing person...I always give link in wordpress forums and they recommend too so that problem could be better understood...Now looking for backlinks...U have time to edit the posts and not to reply to posts... – user2914563 Apr 29 '15 at 13:14
1

You can update the way image is displayed in template. in the page loop it will have something like this:

<?php the_post_thumbnail(); ?>

This grabs the featured image. You can wrap that in a conditional statement to check for whatever you like.

This would show it in every category apart from catgory 3.

<?php if ( !in_category( '3' ) ) : ?>

<?php the_post_thumbnail(); ?>

<?php endif; ?>

Further reading: https://codex.wordpress.org/The_Loop

0

I got an answer to it on some website...

Just edit your css or add some css plugin (jetpack edit css, etc.)

.single .category-video .post-thumbnail img {
    display: none;
}

Replace video with your category name...

No need to change any theme functions...

  • Not the best solution as the user still downloads the image but glad you got it to your liking. – Guerrilla Apr 30 '15 at 14:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.