Using TimThump.php in Functions.php
-
Hey,
So I am using WordPress 3.0 MU. I am creating theme that has different sections on the homepage for 5 different subdirectory blogs. I am using some code I got here (https://www.staenzwebsolutions.com/get-recent-posts-from-various-blogs-on-wordpress-mu-site/324) to select recent posts by blogid and also selecting by category id. I’ll post the code I’m using in a second but heres my problem.
I want to display a thumbnail image as well and have it resized by timthumb.php. When I just display the image link using get_post_meta it works fine, but when i try to resize it using timthumb, no luck.
Anyways, heres my code, any help would be great! thanks
function get_recent_blogposts_featured_nfl($blog_id,$show){ wp_reset_query(); switch_to_blog($blog_id); global $post;?> <?php $my_query = new WP_Query('showposts='.$show.'&order=DSC&category_id=1467'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <img src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=150&w=350&zc=1" /><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <div style="clear:left;"></div> <?php endwhile; ?> <?php restore_current_blog(); }
- The topic ‘Using TimThump.php in Functions.php’ is closed to new replies.