我是Wordpress新手,很难让我的循环使\\u content()不重复。我也尝试过编写多个循环,但都没有用。我主要只想让\\u content()在reveal模式中迭代。
<?php $loop = new WP_Query( array( \'post_type\' => \'c3k_project\', \'posts_per_page\' => 8 ) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<div class="grid-item">
<a href="#" data-reveal-id="myModal">
<figure class="text-overlay">
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), \'single-post-thumbnail\' ); ?>
<img src="<?php echo $image[0]; ?>">
<?php endif; ?>
<figcaption>
<h3><?php the_title(); ?></h3>
<?php the_excerpt(); ?>
<?php the_author(); ?>
</figcaption>
</figure>
</a>
</div>
<div id="myModal" class="reveal-modal full chicken-modal" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog">
<div class="row">
<div class="medium-12 columns">
<?php the_content(); ?>
</div>
</div>
<a class="close-reveal-modal" aria-label="Close">×</a>
</div>
<?php endwhile; wp_reset_query(); ?>