这是你可以得到的代码,先在左边显示10,然后在右边显示
<div class="headlines" data-interval="<?php echo ($interval>0)?$interval*1000:\'false\'; ?>">
<ul class="headline_left">
<?php
$i = 1;
while ( $r->have_posts() ) {
$r->the_post(); ?>
<li>
<?php the_title( \'<a href="\' . get_permalink() . \'">\', \'</a>\' ); ?>
<span class="time_diff"><?php echo \' - \' . dw_human_time_diff( get_the_time(\'U\'), current_time(\'timestamp\') ); ?></span>
</li>
<?php
if($i == 10){
echo "</ul><ul class=\'headline_right\'>";
}
$i++;
}
?>
</ul>
</div>
CSS代码:
.headline_left{
float:left;
width:42%;
padding-right:6%;
/* margin:1px;*/
min-height:40px;
/*padding-left: 1px;*/
}
.headline_right{
float:left;
width:42%;
padding-right:6%;
margin:0;
min-height:40px;
}