need help using timbthumb, custom fields and comma separated images
-
Hi.
I’m trying to use a custom field image in my single.php and index, but I dont know how to make wordpress take out the comma , in between images when it goes to post them.
Example, I have a custom image field called “images” with the following:
https://localhost.com/wp-content/uploads/classipress/hi-yall-1.jpg,https://localhost.com/wp-content/uploads/classipress/hi-yall-2.jpg
and I can show the first image uploaded in single.php with my loop the way I like it:
<?php $postimageurl = get_post_meta($post->ID, 'images', true); ?> <p><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_post_meta($post->ID, "images", true); ?>&w=600&zc=0" alt="" /></p>
if I have more then one image the comma gets placed in the image link and screws it all up.
Same with index.php, if I use more then one image, it inserts the comma and screws the img src url. here is my index page image grab code.
<?php $postimageurl = get_post_meta($post->ID, 'images', true); ?> <div class="thumb"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_post_meta($post->ID, "images", true); ?> &w=300&zc=1" alt="" border="0" /></a>
What would I need to add/do to both my single/index code blocks above, so I can separate the images and not have the comma screw up the img src url when I have more then one image in the custom field?
thanks for any help.
/ end rant
- The topic ‘need help using timbthumb, custom fields and comma separated images’ is closed to new replies.