• Resolved Neddy

    (@a9tm)


    Hi there,

    I’m facing this problem on WP 3.2.1, I’m using Toolbox theme which has provided by Automatic.

    I’d like to have a widget which shows the post thumbnail before the latest post’s title. Everything is ok on testing, but it’s not on production server.

    I’ve followed the_post_thumbnail() on Codex reference page. But the error just changed to: Fatal error: Call to undefined function has_post_thumbnail()

    I have no idea to resolve, so would you please help?
    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Try adding these lines into your functions.php located in theme

    if ( function_exists( ‘add_theme_support’ ) ) {
    add_theme_support( ‘post-thumbnails’ );
    set_post_thumbnail_size( 140, 120 ); // default Post Thumbnail dimensions
    }

    if ( function_exists( ‘add_image_size’ ) ) {
    add_image_size( ‘category-thumb’, 300, 9999 ); //300 pixels wide (and unlimited height)
    add_image_size( ‘homepage-thumb’, 140, 120, true ); //(cropped)
    }

    after this hope your problem will be solved.

    Regards

    Thread Starter Neddy

    (@a9tm)

    @askwhyweb: It works well. Thank you very much for the support.

    Neddy no needs to thanks, Just keep sharing your knowledge with pplz is a good habit. Also wordpress says “Code is poetry” and i really believe in this =)

    Regards,
    Farhan Islam

    Thanks Farhan, you saved my day, it worked for me as well 🙂

    //Here my code------
    global $post;
    global $wp_query;
    query_posts("p=$id&post_type=country"); if(have_posts()) :the_post();
       echo the_title();
       if ( function_exists( 'add_theme_support' ) ) {
    	add_theme_support( 'post-thumbnails' );
    	echo set_post_thumbnail_size( 140, 120 );
    }
    endif;

    //But the result Post thumbnail not shown.
    any idea? please help

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal error: Call to undefined function the_post_thumbnail()’ is closed to new replies.