我正在尝试将query\\u posts放在WP\\u查询中。
我的query\\u帖子之后的任何内容都无法正常工作。这是我的密码。我做错了什么?
<?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; ?>