ThemeShaper Forums » Thematic


get post meta for timthumb

(2 posts)
  • Started 3 years ago by dynamitharry
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. dynamitharry

    Hello! I have got some trouble. I want to use timthumb to resize a image and put it before the title. I used this code, but it want grab the thing!

    `$picture = get_post_meta($post->ID, 'bild', true);
    <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $picture; ?>&h=150&w=150&zc=1" alt="<?php the_title(); ?>" width="150" height="150" />ยด

    I can't even echo just the image.. Do i have to specify a query or something? Thanks a lot if anyone got a link or an answer!

    Posted 3 years ago #
  2. how and where did you use this code? a function? if you echo $picture do you get anything? if you're in a function you have to global $post .

    if you are using a child theme then template_directory puts you in the THEMATIC folder... which may or may not be where the timthumb script is located.

    i'm trying to figure out if you aren't getting anything for your get_post_meta or if your path to timthumb is wrong. basically we need more info before we can help you.

    i'm not sure why you need images in the custom fields any more now that WP supports featured images automatically. there is even a plugin that lets you have multiple featured images.

    justin tadlock explains featured images (plus he has a good plugin for post images):

    and Morten Skogly explains how to use Tadlock's get the image plugin in conjunction with TimThumb:

    Justin tadlock's Get the Image plugin does work automatically if you call the

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.