Php 循环索引插件jeckpack post视图

Php 循环索引插件jeckpack post视图,php,wordpress,loops,jetpack,Php,Wordpress,Loops,Jetpack,我正在尝试获取循环的索引以便查看。我正在使用Jetpack Post视图进行此操作 浏览量最大的帖子是first等等 我在namo电影中使用自定义贴子,只是queensize我的循环没有带来此自定义贴子 有人能帮我吗 <div id="content"> <?php if( function_exists( 'stats_get_csv' ) ) : $top_posts = stats_get_csv( 'postviews', array( 'days' =>

我正在尝试获取循环的索引以便查看。我正在使用Jetpack Post视图进行此操作

浏览量最大的帖子是first等等

我在namo电影中使用自定义贴子,只是queensize我的循环没有带来此自定义贴子

有人能帮我吗

<div id="content">
<?php if( function_exists( 'stats_get_csv' ) ) :
    $top_posts = stats_get_csv( 'postviews', array( 'days' => 21, 'limit' => -1 ) );
    $top_ids = array();
    foreach ( $top_posts as $top_post ) {
        $top_ids[] = $top_post['post_id'];
    }

    // Check for transient, hat tip Greg Rickaby
    if ( false === ( $tops = get_transient( 'popular_posts' ) ) ) :

        $top_args = new WP_Query( array(
        'posts_per_page' => '5',
        'post__in' => $top_ids,
        'posts_per_page' => 14,
        'post_type' => array('movies')
        )
    );
     $tops = new WP_Query( $top_args );

        // Store transient and expire after 24 hours
        set_transient( 'popular_posts', $tops, 24 * HOUR_IN_SECONDS );

    endif; 
while ($tops->have_posts()) : $tops->the_post(); ?> 

<div class="box " id="post-<?php the_ID(); ?>">

<div class="boxim">
<?php
if ( has_post_thumbnail() ) { ?>
    <a href="<?php the_permalink() ?>"><img class="boximg" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&amp;h=270&amp;w=180&amp;zc=1" alt=""/></a>
<?php } else { ?>
    <a href="<?php the_permalink() ?>"><img class="boximg" src="<?php bloginfo('template_directory'); ?>/images/dummy.png" alt="" /></a>
<?php } ?>

<div class="scorebox">
<span class="sholder"> <span class="scorebar score-<?php $rscore=get_post_meta($post->ID, 'wtf_rscore', true); echo $rscore; ?>"> </span>    </span>
</div>

</div>

<div class="boxentry">
<div class="btitle">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
</div>
<div class="bmeta">
<span class="mgenre"><?php echo get_the_term_list( $post->ID, 'movie-genre', '', ', ', '' ); ?></span> <span class="mcom"><?php comments_popup_link('0', '1', '%'); ?></span>
</div>
<div class="clear"></div>
</div>
</div>

<?php if(++$counter % 3 == 0) : ?>
<div class="clear"></div>
<?php endif; ?>

<?php endwhile; wp_reset_postdata(); ?>

<div class="clear"></div>
<?php getpagenavi(); ?>
<?php endif; ?>

</div>