admin管理员组文章数量:1389897
I've browsed all the other questions that could be related to this and still can't find the answer. My code is only displaying the results of the loop in the first tab, but won't show it in the second tab. Can't figure out why. See code below:
<div class="tab-panels">
<div class="panel entry-content active" id="tab_all-lines">
<!-- Full Menu -->
<?php
$loop = new WP_Query(
array(
'post_type' => 'featured_item',
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC',
)
);?>
<ul id="menu-manufacturers-all-lines" class="menu">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li class="menu-item menu-item-type-post_type menu-item-object-featured_item">
<a href="<? the_permalink(); ?>"><? the_title();?></a>
</li>
<?php endwhile;?>
</ul>
<?php wp_reset_postdata(); ?>
</div>
<div class="panel entry-content" id="tab_lines-we-stock">
<!-- Filter Menu -->
<?php
$loop_stock = new WP_Query(
array(
'post_type' => 'featured_item',
'post_status' => 'publish',
'posts_per_page' => -1,
'category_name' => 'lines-we-stock',
'orderby' => 'title',
'order' => 'ASC'
)
);?>
<ul id="menu-manufacturers-all-lines" class="menu">
<?php while ( $loop_stock->have_posts() ) : $loop_stock->the_post(); ?>
<li class="menu-item menu-item-type-post_type menu-item-object-featured_item">
<a href="<? the_permalink(); ?>"><? the_title();?></a>
</li>
<?php endwhile;?>
</ul>
<?php wp_reset_postdata(); ?>
</div>
</div>
本文标签: custom post typesMultiple Loops In Tabs Only Displaying First Loop
版权声明:本文标题:custom post types - Multiple Loops In Tabs Only Displaying First Loop 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744586971a2614254.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论