Posted By

kristarella on 04/28/09


Tagged

wordpress thesis excerpt thesiswp


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

girliegeek
joelhaus
philipanderson
thesislab
naeemnur


Custom Thesis teasers


 / Published in: PHP
 

This provides a teaser, with content from a custom feild, or the excerpt if no field exists. Everything except the title and edit link need to be turned off in the options.

  1. function teaser_excerpt() {
  2. $teaser = get_post_meta(get_the_id(), 'custom_teaser', true);
  3. thesis_teaser_date();
  4. echo ' <div class="format_teaser entry-content">' . "\n";
  5. if ($teaser)
  6. echo '<p>' . $teaser . '</p>';
  7. else
  8. the_excerpt();
  9. echo ' </div>' . "\n";
  10. thesis_teaser_link();
  11. }
  12. add_action('thesis_hook_after_teaser_headline','teaser_excerpt',99);

Report this snippet  

You need to login to post a comment.