Jump to content

Need help with WP and TimThumb


quickfire84

Recommended Posts

Ok, I wrote a code for using custom fields to display images, and im using it to display thumbnails so i have the code grab it and send it threw the TimThumb php image resizing script to make the image smaller for the front page, everything works except the TimThumb, it doesn't work for me.

 

 

this is the code to grab the img url from the custom field:

 

 


<?php query_posts('category_name=blog&showposts=5'); if(have_posts()) : while(have_posts()) : the_post();
    // check for thumbnail
    $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true);
    // check for thumbnail class
    $thumb_class = get_post_meta($post->ID, 'Thumbnail Class', $single = true);
    // check for thumbnail alt text
    $thumb_alt = get_post_meta($post->ID, 'Thumbnail Alt', $single = true);
    ?>



		<div class="blogArea" id="post-<?php the_ID(); ?>">

                <div id="blogThumb">
                <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php echo $thumb; ?>&w=100&h=65&zc=1&q=100"
alt="<?php the_title(); ?>" class="left" width="100px" height="65px"  />
                </div>
			<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
			<div class="date"><?php the_time('M d, Y') ?> <!-- by <?php the_author() ?> --></div>

			<?php the_content('Read more»'); ?>

		</div>

	<?php endwhile; ?>

 

This is the little bit of code that takes the image url from the custom field and puts it into the timthumb script

 

<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php echo $thumb; ?>&w=100&h=65&zc=1&q=100"
alt="<?php the_title(); ?>" class="left" width="100px" height="65px"  />

 

and as you can see here http://cardarello.com  the images never show up

 

But in this theme from Elegant Themes uses the same type of custom field coding and put it threw the timthumb and works fine.. http://www.elegantthemes.com/preview/Influx/ 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.