Add featured image as thumbnail to posts

  • Anonymous


    I am going crazy with this:

    the featured image is displayed in the post excerpt on the home page but it isn’t in the article. I threw the following code in the functions.php:

    * Add featured image as thumbnail to posts
    function graphene_post_thumbnail(){
    if ( has_post_thumbnail() ) the_post_thumbnail( 'thumbnail', array( 'class' => "attachment-$size alignleft" ) );
    add_action( 'graphene_before_post_content', 'graphene_post_thumbnail' );

    I got the thumbnail on the left in the article but now I am getting 2 similar thumbnails next to each other in the excerpt on the home page.

    Any idea how to solve this?




    Merry Christmas to all the team of Graphene 😀


    if( has_post_thumbnail() && is_single() )



    Thanks Prasanna, it worked great. Merry Christmas.

Viewing 4 posts - 1 through 4 (of 4 total)

  • You must be logged in to reply to this topic.
Graphene Themes Forum