2 replies
  • WEB DESIGN
  • |
Hello,

i have problem with featured image in posts. I want thats only shows featured image in home page, but when you click read more to show whole post i dont want image that is there.
Anyone have any idea?
Now shows featured image in home page and also in whole post when you open it.

tnx for your help
#featured #image
  • Profile picture of the author clickbump
    Hi Mantara, the best way to do this is to modify single.php so that you remove the featured image on your post page.

    If you want to give that a shot, you should make a backup copy of your single.php file then make the changes to remove the the_post_thumbnail() directive. It will look something like this depending on your theme designer's implementation of it:

    Code:
    <?php the_post_thumbnail();?>
    Another way to do it is with custom css. However, this is not optimal because you are simply "hiding" the image from the viewer. It still is present in the markup and the browser/device still has to download the image. However, if it has already been loaded on the home page, its probably cached in memory, so that's not a concern if you are using the same size image on both pages.

    To remove the featured image from posts, use this custom css:

    Code:
    body.single .wp-post-image{display:none}
    You can place that at the end of the file found at "Appearance > Editor > style.css" and click "Save"
    Signature
    {{ DiscussionBoard.errors[7427974].message }}
  • Profile picture of the author Mantara
    Tnx clickbump.
    I removed <?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(300,225), array("class" => "alignleft post_thumbnail")); } ?> and its working

    Tnx again, you save my day
    {{ DiscussionBoard.errors[7428390].message }}

Trending Topics