BxSlider Loop Problem WP_Query Issues with Meta Values
-
I’ve got the BX slider setup and working very nice.
I’ve created a custom post type, then created a taxonomy category under it and then created meta fields under the taxonomy.
I’m trying to display a box with Coming Soon on the images as they scroll through if one of the custom meta fields equals yes. It does this by reading the Yes value, and then passing the Coming Friday words as the Title for the Title for the captions value in BxSlider Jquery file.
I’ve got every thing to work except the get_post_meta is only returning the first item in the loop and placing the overlay on that one item.
I bet it’s something really simple but I can’t seem to get it.
Here is the code that is working so far:
function thumb_slider_shortcode() { $content = '<div class="slider_box"><ul class="bxslider">'; $loop = new WP_Query( array( 'post_type' => 'movie', 'posts_per_page' => 10, 'tax_query' => array( array( 'taxonomy' => 'movie-category', 'terms' => array('coming-soon','profile_friday'), 'field' => 'slug', ) ) ) ); while ( $loop->have_posts() ) : $loop->the_post(); $thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id,'full', true); $content .= ' <li><a href="'; $content .= get_permalink(); $content .= '"><img src="'; $content .= $thumb_url[0]; $content .= '" title="'; $args .= get_post_meta($loop->post_ID , 'profile_friday', true); if($args == "Yes") { $content .= "Coming Friday" ; } else $content .= "" ; $content .= '"/></li> '; endwhile; $content .= '</div>'; echo $content; echo get_post_meta($post->ID,'profile_rating',true) ; }
I’ve been at this now for many, many hours…… Any help would be greatly appreciated ??
- The topic ‘BxSlider Loop Problem WP_Query Issues with Meta Values’ is closed to new replies.