How to add timthumb to featured post slider
-
Hi,
I’m using the following code for a jquery slider that pulls images from posts within a given category. It works fine, but I’d like to add the timthumb script to save having to resize each image.I have timthumb set up correctly in a scripts directory, but I am struggling to add the extra code to the slider code so that the script applies to the images that are generated.
Can anyone point me in the right direction?
<ul id="carousel"> <?php $featured_posts = get_posts('numberposts=7&category=$cat'); foreach( $featured_posts as $post ) { $custom_image = get_post_custom_values('featured_image', $post->ID); $image = $custom_image[0] ? $custom_image[0] : get_bloginfo("template_directory")."/images/no-featured-image.jpg"; printf('<li><a href="%s"title=""><h2 class="slidrpostheading">%s</h2><img src="%s" alt="%s" /></a></li>', get_permalink($post->ID), $post->post_title, $image, $post->post_title); } ?> </ul>
Thanks!
Jimmmy
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to add timthumb to featured post slider’ is closed to new replies.