【发布时间】:2015-04-21 04:33:25
【问题描述】:
我正在使用 Wordpress 和 Foundation 选项卡。
目标:
在垂直 Foundation 选项卡中显示来自特定类别的 Wordpress 帖子。
我目前有一个静态版本显示在这里:
http://www.aos-engineering.com(项目下)
问题:
在页面加载时,显示的第一个选项卡是空的。但是,当您单击选项卡时,它们会正确显示。
问题
如何在页面加载时显示第一个选项卡项?
这是显示问题的测试页面:
http://www.aos-engineering.com/test/
代码
<div class="full-width" id="projects">
<div class="row">
<div class="small-4 medium-3 large-3 columns">
<dl class="tabs vertical profile-tabs" data-tab>
<?php
$displayposts = new WP_Query();
$displayposts->query('category_name=Projects');
while ($displayposts->have_posts()) : $displayposts->the_post();
$tab_number = $displayposts->current_post + 1;
?>
<dd><a href="#tab<?php echo $tab_number;?>"><?php the_title(); ?></a></dd>
<?php endwhile; ?>
</dl>
</div>
<div class="small-8 medium-9 large-9 columns">
<div class="tabs-head">Projects</div>
<div class="tabs-content">
<?php
while ($displayposts->have_posts()) : $displayposts->the_post();
$tab_number = $displayposts->current_post + 1;
?>
<div class="content" id="tab<?php echo $tab_number;?>">
<h2><?php the_title(); ?></h2>
<div class="row">
<div class="medium-9 large-9 columns">
<?php the_post_thumbnail(); ?>
<p><small><?php the_field('img_caption'); ?></small></p>
</div>
<div class="medium-3 large-3 columns">
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
如果我能提供更多信息,请告诉我。提前谢谢你。
【问题讨论】:
标签: wordpress tabs zurb-foundation