Multiple custom field values in one
-
Hey,
New to WordPress, (and PHP) and I’m having some trouble with custom fields, hopefully you guys can help me with it.
I’m trying to create a fancy-box image gallery with custom fields, but I can’t find info anywhere that shows me how to combine field values into one statement.
For example, I have these two values:
1) Thumbnail = image_thumb.jpg
2) Full-size = image.jpgI’m using the following code:
<?php $image_path = wp_upload_dir(); $custom_path= $image_path['baseurl'].'/'.$post->post_name;; ?> <?php $thumb = get_post_meta($post->ID, 'Thumbnail', false); ?> <?php $full_size = get_post_meta($post->ID, 'Full_size', false); ?> <?php foreach($thumb as $thumb) { echo '<li><a class="zoom1" href="'.$custom_path.'/'.$full_size.'" rel=""/><img src="'.$custom_path.'/'.$thumb.'" /></a></li>'; } ?>It loops through each thumbnail key and shows the thumbnail image just fine, but puts the full-size image link as an array. (http://PATH/wp-content/uploads/POSTNAME/Array).
Can someone please show me how I would add the full-size image in there so that the full line of code looks like this?:
<li><a class="zoom1" href="http://PATH/wp-content/uploads/POSTNAME/full-size.jpg" rel="POSTNAME"/><img src="http://PATH/wp-content/uploads/POSTNAME/full-size.jpgthumb.jpg" /></a></li>
The topic ‘Multiple custom field values in one’ is closed to new replies.