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 thumbnails for excerpts on home page « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Post thumbnails for excerpts on home page

(3 posts)
  • Started 4 years ago by jervatron
  • Latest reply from middlesister
  • This topic is not resolved

  1. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    jervatron

    Member

    Hey guys,
    I'm struggling with a post thumbnail issue on my website. . . the thumbnails show up on archive and category pages, but not on the home page.
    I've looked through the forums here, and I'm not well versed enough in PHP to fully understand which php function I need to edit to enable this; so I was hoping for a little guidance.

    Posted 4 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    jervatron

    Member

    I now see in the content-extensions.php file where different returns (e.g.: search results/archive/category listing/front page) are spelled out as either $content = 'full' or $content = 'excerpt'
    It appears that anything set to 'full' won't display the post thumbnail, whereas 'excerpts' will.
    How can I set 'full' posts to display a post thumbnail?

    That actually progresses me to a new question: How can I disable the automatic truncating? I also set the "Read more" manually, so I'd like it to NOT automatically chop off content at 55 words (I found in the helpers.php file where the excerpt size is set to 55 words, but changing that value seems to do nothing)
    Thanks for any and all help/hints

    Posted 3 years ago #
  3. middlesister
    Member

    First of all you are using a child theme, right? You should not edit any of the thematic core files, any customization is done via filters and hooks in your child theme's functions.php

    The length of the excerpt is not decided by thematic but wordpress itself. But it doesn't really matter since the method is the same. You change it with a filter. Add this code to your functions.php and change the number to the number of words you want instead.

    function new_excerpt_length($length) {
    	return 20;
    }
    add_filter('excerpt_length', 'new_excerpt_length');

    As for the thumbnails, thematic only adds them on the excerpts by default. The same applies here. You can add thumbnails to full post content with a filter

    function add_thumbnails_to_content($post) {
    	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;
    	}
    	return $post;
    }
    add_filter('the_content' , 'add_thumbnails_to_content');

    This will add the thumbnails everywhere, use conditional logic if you only want them on specific parts of your site.

    Posted 3 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