PageRenderTime 35ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/news/page-template-popular.php

https://bitbucket.org/lgorence/quickpress
PHP | 65 lines | 30 code | 27 blank | 8 comment | 2 complexity | ffa3c3f2eee0c6f5c235f51fe9089bb6 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-1.0
  1. <?php
  2. /**
  3. * Template Name: Popular Posts
  4. *
  5. * Template for showing popular posts.
  6. *
  7. * @package News
  8. * @subpackage Template
  9. */
  10. get_header(); ?>
  11. <?php do_atomic( 'before_content' ); // Before content hook ?>
  12. <div id="content">
  13. <?php do_atomic( 'open_content' ); // Open content hook ?>
  14. <div class="hfeed">
  15. <?php get_template_part( 'loop-meta' ); // Get the loop meta box ?>
  16. <?php $wp_query = new WP_Query( array( 'ignore_sticky_posts' => true, 'meta_key' => 'Views', 'orderby' => 'meta_value_num', 'posts_per_page' => get_option( 'posts_per_page' ), 'paged' => ( get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1 ) ) ); ?>
  17. <?php if ( $wp_query->have_posts() ) : ?>
  18. <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
  19. <?php do_atomic( 'before_entry' ); // Before loop hook ?>
  20. <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
  21. <?php do_atomic( 'open_entry' ); // Open loop hook ?>
  22. <?php get_the_image( array( 'meta_key' => array( 'Thumbnail' ), 'size' => 'news-thumbnail' ) ); ?>
  23. <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
  24. <?php echo apply_atomic_shortcode( 'byline', '<div class="byline">[entry-published] [entry-comments-link] [entry-popup-shortlink] [entry-edit-link before=" | "]</div>' ); ?>
  25. <div class="entry-summary">
  26. <?php the_excerpt(); ?>
  27. </div><!-- .entry-summary -->
  28. <?php do_atomic( 'close_entry' ); // Close loop hook ?>
  29. </div><!-- .hentry -->
  30. <?php do_atomic( 'after_entry' ); // After loop hook ?>
  31. <?php endwhile; ?>
  32. <?php endif; ?>
  33. </div><!-- .hfeed -->
  34. <?php do_atomic( 'close_content' ); // Close content hook ?>
  35. <?php get_template_part( 'loop-nav' ); ?>
  36. </div><!-- #content -->
  37. <?php do_atomic( 'after_content' ); // After content hook ?>
  38. <?php get_footer(); ?>