I am trying to put a query_posts inside a WP_query.
Anything after my query_posts doesn't work properly. Here is my code. What am I doing wrong?
<?php
$args = array( 'post_type' => 'product', 'posts_per_page' => 1, 'product_cat' => 'featured' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
<div id="latest">
<h2>The Latest Issue</h2>
<div id="breaking-bg">
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail();
}
?>
</div>
<div class="breaking">
<div id="featured-content">
<p class="datetime"><?php the_date(); ?></p>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<h4>What's Inside:</h4>
<ul class="preview olLoop">
<?php query_posts( array ( 'category_name' => 'Magazine Preview', 'posts_per_page' => 3 ) ); ?>
<?php while (have_posts()) : the_post(); ?>
<li>
<a href="<?php $featuredImage = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); echo $featuredImage;?>" rel="lightbox" title="">
Photo Preview
<br>
<strong><?php the_title(); ?></strong>
</a>
</li>
<?php endwhile; ?>
</ul>
<h3>Available Now.<br>
For Free.</h3>
<a href="<?php echo get_post_meta( get_the_ID(), 'magazine_url', true ); ?>" class="button read-it" target="_blank">Read It <i class="icon-chevron-sign-right"></i></a>
<?php echo get_post_meta($post->ID, 'magazine_url', true); ?>
</div>
</div><!--/breaking-->
<?php endwhile; ?>