Advertisement
helgatheviki

Updated (Working) More Type for Thematic

Mar 26th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.33 KB | None | 0 0
  1. //change where theme uses excerpts
  2. function childtheme_content($content) {
  3.     if (is_home() || is_archive()) {
  4.         $content= 'more';
  5.     }
  6.     return $content;
  7. }
  8. add_filter('thematic_content', 'childtheme_content');
  9.  
  10.  
  11. function childtheme_excerpts($content) {
  12.     global $thematic_content_length, $post;
  13.    
  14.         if ( strtolower($thematic_content_length) == 'more' ) {
  15.  
  16.             if ( preg_match('/<!--more(.*?)?-->/', $post->post_content ) ) {   
  17.                 $content = get_the_content(more_text());
  18.                 $content = apply_filters('the_content', $content);
  19.                 $content = str_replace(']]>', ']]&gt;', $content);
  20.                
  21.             } else {
  22.                 $content = '';
  23.                 $content .= get_the_excerpt();
  24.                 $content = apply_filters('the_excerpt',$content);
  25.                 if ( apply_filters( 'thematic_post_thumbs', TRUE) ) {
  26.                     $content_title = get_the_title();
  27.                     $size = apply_filters( 'thematic_post_thumb_size' , array(100,100) );
  28.                     $attr = apply_filters( 'thematic_post_thumb_attr', array('title'    => 'Permalink to ' . $post_title) );
  29.                     if ( has_post_thumbnail() ) {
  30.                         $content = '<a class="entry-thumb" href="' . get_permalink() . '" title="Permalink to ' . get_the_title() . '" >' . get_the_post_thumbnail(get_the_ID(), $size, $attr) . '</a>' . $content;
  31.                     }
  32.                 }
  33.             }
  34.                    
  35.  
  36.         }
  37.                        
  38.     return $content;
  39.    
  40. }
  41.  
  42. add_filter('thematic_post', 'childtheme_excerpts');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement