Support » Fixing WordPress » How to add timthumb to featured post slider

Viewing 1 replies (of 1 total)
  • update…

    I figured it out!

    `<ul id=”carousel”>
    $featured_posts = get_posts(‘numberposts=7&category=$cat’);

    foreach( $featured_posts as $post ) {
    $custom_image = get_post_custom_values(‘thumb’, $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=”http://www.mysite/wp-content/themes/mytheme/scripts/timthumb.php?w=233&h=157&zc=1&src=%s” alt=”%s” /></a></li>’, get_permalink($post->ID), $post->post_title, $image, $post->post_title);
    I figured out you have to have an absolute path coz it’s within the printf. I’m sure there is a much tidier way to do this, but it works at least.

    For anyone that’s interested, here’s a cool hack for timthumb:

Viewing 1 replies (of 1 total)
  • The topic ‘How to add timthumb to featured post slider’ is closed to new replies.