ThemeShaper Forums » Thematic

[closed]

Inserting post-thumbnails in Thematic

(4 posts)
  • Started 4 years ago by michieldoetjes
  • Latest reply from mrsmarshah
  • This topic is resolved
  1. michieldoetjes
    Member

    Hi! I'm relatively new to Thematic. I'm amazed by how powerful this framework is and how easy it is to build your own child-themes.

    I want to add post thumbnails to my child theme, but I'm struggling getting it right. Steps I took:

    1. I added the thumbnail function to my functions.php using the following code:

    add_theme_support('post-thumbnails');

    2. I added the call for the thumbnail to my customized post-header (function: mdv5_postheader) using the following code:

    $postmeta .= the_post_thumbnail();

    3. And this is where the problem starts: it doesn't matter where in the postheader I place the call for the thumbnail, it automatically places the thumbnail above the post-title.

    Any ideas on what I might be doing wrong?

    Posted 4 years ago #
  2. Hi,

    using the 'wrong' function call ;)

    the_post_thumbnail will echo the result instead of to return it.

    Use get_the_post_thumbnail instead.

    Chris

    Posted 4 years ago #
  3. michieldoetjes
    Member

    Brilliant, thanks!

    *Solved*

    Posted 4 years ago #
  4. mrsmarshah
    Member

    Hi Chris,

    I am having the same problem but I am using get_the_post_thumbnail. What am I still doing wrong? (thumbnail is displayed above the title)


    add_theme_support('post-thumbnails');
    set_post_thumbnail_size( 250, 250, true );
    function my_post_title($title) {
    if (is_category()) {
    return get_the_post_thumbnail(NULL, 'thumbnail') . $title;
    } else {
    return $title;
    }
    }
    add_filter('thematic_postheader_posttitle', 'my_post_title');

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.