Posted By

kristarella on 08/12/10


Tagged

wordpress thesis thesiswp


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

manavecplan
naeemnur


Fallback Thesis Thumbnail


 / Published in: PHP
 

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.

  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
Posted By: naeemnur on December 11, 2010

how can i change the thesis_thumb custom field to post-img? any help will be appreciated.

You need to login to post a comment.