Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Post Thumbnail and Excerpt in Posts Page « ThemeShaper Forums

ThemeShaper Forums » Thematic


Post Thumbnail and Excerpt in Posts Page

(1 post)
  • Started 4 years ago by Pictrix
  • This topic is not resolved
  1. Pictrix

    I wanted to show a Post Thumbnail and an Excerpt only in the Posts Page (index.php). The excerpt had to include the "Read More" link regardless of its length instead of ellipsis.

    I searched the forum and I found bits here and there. What I finally came up with follows. I am no PHP expert, but it might be helpful to anyone looking to achieve the same result. If there's a better way to do this, I'm all ears!

    // ----- SHOW EXCERPT AND THUMBNAIL IN POSTS PAGE-------------------------------
    // ------------- * 1) Activate excerpts in posts page:
    // ------------- From here:

    function child_content($content) {
    if ( is_home() ) { //this is the posts page, see
    $content = 'excerpt';
    return $content;
    add_filter('thematic_content', 'child_content');

    // ------------- * 2) Have all excerpts include a "Read More" (regardless of post lenght):
    // ------------- (Only excerpts longer than 55 words will get it automatically)
    // ------------- From here:

    function all_excerpts_get_more_link($post_excerpt) {
    return $post_excerpt . '
    ID) . '">' . 'Read More...' . '';
    add_filter('wp_trim_excerpt', 'all_excerpts_get_more_link');

    // ------------- * 3) Remove ellipsis from excerpts longer than 55 words
    // ------------- From here:

    function excerpt_ellipse($text) {
    return str_replace('[...]', '

    ', $text); }

    add_filter('get_the_excerpt', 'excerpt_ellipse');

    // ------------- * 4) Activate the post thumbnail feature:

    // ------------- * 5) Add post thumbnail to the posts (index) page:
    function my_postheader($postheader) {
    if ( is_home() ) {
    $postmeta .= the_post_thumbnail();
    return $postheader;
    add_filter('thematic_postheader', 'my_postheader');

    // ----- END -------------------------------------------------------------------

    I hope this helps, or at least gets you started.

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183