Fallback Thesis Thumbnail


/ Published in: PHP
Save to your folder(s)

The code to call the normal Thesis Thumb is at http://snipplr.com/view/38971/thesis-thumbnail/\r\n\r\nTo test whether there is a thumbnail, and if not use another one, use this code in custom_functions.php.\r\n\r\nYou can change the class alignleft to alignright, or aligncenter and you can add the class frame to give the thumbnail a border.


Copy this code and paste it in your HTML
  1. function custom_thesis_thumb() {
  2. global $post;
  3. $post_image = thesis_post_image_info('thumb');
  4. if (!$post_image['url'])
  5. echo '<a href="' . get_permalink($post->ID) . '"><img src="YOUR DEFAULT THUMB URL" class="thumb alignleft" /></a>';
  6. }
  7. add_action('thesis_hook_before_teaser','custom_thesis_thumb');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.