我正在尝试添加css类.is-active
到循环内的垂直选项卡链接。
默认情况下,页面首先加载最新的帖子。如何使用激活最近的选项卡/帖子.is-active
?
<?php
$races_2016=\'0\';
$args = array(
\'post_type\' => \'races\',
\'order\' => \'DESC\',
\'parent\' => \'$races_2016\',
\'orderby\' => \'date\',
);
$the_query = new WP_Query( $args ); ?>
<!-- Tab Buttons -->
<div class="vertical-tabs">
<p><?php echo date(\'Y\'); ?> Race Results</p>
<?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts()) : $the_query->the_post(); ?>
<a href="javascript:void(0)" class="js-vertical-tab vertical-tab page-item" rel="<?php the_ID();?>">
<?php the_title(); ?>
</a>
<?php endwhile; else: ?>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
</div>
<!-- Tab Buttons -->