Title: if thumbnail design
Last modified: August 19, 2016

---

# if thumbnail design

 *  Resolved [fundin](https://wordpress.org/support/users/fundin/)
 * (@fundin)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/if-thumbnail-design/)
 * I’m trying to ad a link with a class to my thumbnails but I don’t want the link
   and css to show if there’s is no thumbnail available, not it still shows the “
   frame” for the picture, since it’s a permalink. (see the posts without a thumbnail:
   [http://www.josefinfundin.com/](http://www.josefinfundin.com/) )
 * this is my code
    `<a href="<?php the_permalink() ?>" class="thumb-preview"><?
   php the_post_thumbnail( 'thumbnail' ); ?> </a>`
 * I’ve tried to build an if function where the <a code is called if the_post_thumbnail
   exist.. but unsuccessfully
 * help please 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/if-thumbnail-design/#post-1400590)
 * [http://codex.wordpress.org/Template_Tags/has_post_thumbnail](http://codex.wordpress.org/Template_Tags/has_post_thumbnail)
 *  Thread Starter [fundin](https://wordpress.org/support/users/fundin/)
 * (@fundin)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/if-thumbnail-design/#post-1400661)
 * Thanks for the link but that doesn’t really seem to help with my problem. I’ve
   already called the thumbnail.. and I’ve tried the if thumbnail script.. BUT the
   problem is this:
 * I only want the [ and ](https://wordpress.org/support/topic/if-thumbnail-design/?output_format=md#)
   to be executed IF a thumbnail exist.. but I can’t seem to integrate it in to 
   the if function
 *  Thread Starter [fundin](https://wordpress.org/support/users/fundin/)
 * (@fundin)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/if-thumbnail-design/#post-1400672)
 * that was supposed to say `<a href="#"> </a>`

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘if thumbnail design’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [if](https://wordpress.org/support/topic-tag/if/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [fundin](https://wordpress.org/support/users/fundin/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/if-thumbnail-design/#post-1400672)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
