php - Loop the index plug-in jeckpack post view -
php - Loop the index plug-in jeckpack post view -
i'm trying index of loop in order list viewing. i'm using jetpack post views this
ex: viewed post first , on.
i utilize custom post namo movies , queensize loop not bringing custom post.
could help me ?
<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 $top_post ) { $top_ids[] = $top_post['post_id']; } // check 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 , 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(); ?>&h=270&w=180&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 <?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> php wordpress loops jetpack
Comments
Post a Comment