Skip to content

Instantly share code, notes, and snippets.

@scottnix
Created September 19, 2012 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottnix/3750712 to your computer and use it in GitHub Desktop.
Save scottnix/3750712 to your computer and use it in GitHub Desktop.
Thematic Theme Excerpt Read More on both manual and auto excerpt.
function childtheme_override_content() {
global $thematic_content_length;
if ( strtolower($thematic_content_length) == 'full' ) {
$post = get_the_content( thematic_more_text() );
$post = apply_filters('the_content', $post);
$post = str_replace(']]>', ']]>', $post);
} elseif ( strtolower($thematic_content_length) == 'excerpt') {
$post = '';
$post .= get_the_excerpt();
$post .= '... <a href="'.get_permalink().'"> Read More »</a>';
$post = apply_filters('the_excerpt',$post);
if ( apply_filters( 'thematic_post_thumbs', TRUE) ) {
$post_title = get_the_title();
$size = apply_filters( 'thematic_post_thumb_size' , array(100,100) );
$attr = apply_filters( 'thematic_post_thumb_attr', array('title' => 'Permalink to ' . $post_title) );
if ( has_post_thumbnail() ) {
$post = '<a class="entry-thumb" href="' . get_permalink() . '" title="Permalink to ' . get_the_title() . '" >' . get_the_post_thumbnail(get_the_ID(), $size, $attr) . '</a>' . $post;
}
}
} elseif ( strtolower($thematic_content_length) == 'none') {
} else {
$post = get_the_content( thematic_more_text() );
$post = apply_filters('the_content', $post);
$post = str_replace(']]>', ']]&gt;', $post);
}
echo apply_filters('thematic_post', $post);
}
function childtheme_excerpt_trailing($text) {
return str_replace('[...]', '', $text);
}
add_filter('get_the_excerpt', 'childtheme_excerpt_trailing');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment