Hello guys !
I'm developing a "gallery" page and i'm using a custom post type, then for the gallery custom post type i've add custom metaboxes and everything is working but i've got a little problem...
here is the code i'm using to display my gallery entries
<?php $loop = new WP_Query( array( 'post_type' => 'gallerylist', 'posts_per_page' => 100 , 'order' => 'ASC', 'paged'=>$paged ) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php $full_picture = get_post_meta($post->ID, 'ep_full_picture', true); ?>
<?php $thumb = get_post_meta($post->ID, 'ep_thumbnail_gallery', true); ?>
<?php $is_last = get_post_meta($post->ID, 'ep_is_fourth', true); ?>
<div class="one_fourth gallery-picture ">
<div class="gallery_frame image">
<a class="fancy" href="<?php echo $full_picture; ?>"><img src="<?php echo $thumb; ?>" alt=""/></a>
</div>
</div>
<?php endwhile; ?>
Within my custom meta box i've created a select tag with two option : "No" and "Yes"
this is the code for my select meta box option
array(
'name' => 'Is this the fourth picture ?',
'desc' => 'If this is the fourth picture (per row) select yes.',
'id' => $prefix . 'is_fourth',
'type' => 'select',
'options' => array('No', 'Yes'),
'std' => 'No'
),
What i need is that, if the user select the "Yes" option, the yes option will echo the class "last" so, doing this the code will results :
<div class="one_fourth gallery-picture LAST">
<div class="gallery_frame image">
<a class="fancy" href="<?php echo $full_picture; ?>"><img src="<?php echo $thumb; ?>" alt=""/></a>
</div>
</div>
how can i achieve this ? I've tried a couple of thing but wasn't working... >__<
thanks.