我有3个用jQuery Ui制作的标签,在每个标签中我需要做出不同的标记和内容,每个标签都有唯一的ID。我如何插入带有id#tabs-2的标签,这个内容。如果我尝试在the_content之后插入它,它会在每个标签中生成相同的内容。
<div id="tabs-2">
<div class="row">
<div class="col-md-3">
<img src="img/about_multi.gif" alt="">
<h4>We Are Multi-Disciplinary</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic consequatur voluptatum illum commodi, possimus culpa incidunt vero repudiandae neque quas, rerum quis, consequuntur illo molestiae necessitatibus ea explicabo architecto impedit!</p>
</div>
这就是它现在的样子!
<?php
$id = 7;
$post_tabs = new WP_Query(array('cat'=> $id, 'post_per_page' => 5));
?>
<?php if ($post_tabs-> have_posts() ) : ?>
<div class="tabs">
<ul class="menu-nav">
<?php while ( $post_tabs->have_posts() ) : $post_tabs->the_post(); ?>
<li><a href="#tabs-<?php the_ID(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<?php while ( $post_tabs->have_posts() ) : $post_tabs->the_post(); ?>
<div id="tabs-<?php the_ID(); ?>">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
</div>
<?php else: ?>
<!-- no posts found -->
<?php endif; ?>
答案 0 :(得分:0)
只需检查相应的ID:
Sort()