Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Most Popular
- *
- * @package Path
- * @subpackage Template
- */
- get_header(); // Loads the header.php template. ?>
- <?php do_atomic( 'before_content' ); // my-life_before_content ?>
- <div id="content">
- <?php do_atomic( 'open_content' ); // my-life_open_content ?>
- <div class="hfeed">
- <?php get_template_part( 'loop-meta' ); // Loads the loop-meta.php template. ?>
- <?php if ( have_posts() ) : ?>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php do_atomic( 'before_entry' ); // my-life_before_entry ?>
- <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
- <?php do_atomic( 'open_entry' ); // my-life_open_entry ?>
- <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
- <div class="entry-content">
- <?php the_content(); ?>
- </div><!-- .entry-content -->
- <?php do_atomic( 'close_entry' ); // my-life_close_entry ?>
- </div><!-- .hentry -->
- <?php do_atomic( 'after_entry' ); // my-life_after_entry ?>
- <?php endwhile; ?>
- <?php else : ?>
- <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
- <?php endif; ?>
- <?php
- /* Loop for most viewed articles. entry-views extension is in use. */
- $args = 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 )
- );
- $wp_query = new WP_Query( $args );
- if ( $wp_query->have_posts() ) :
- while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
- <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
- <?php if ( current_theme_supports( 'get-the-image' ) ) get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'thumbnail' ) );?>
- <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
- <?php echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( 'Published by [entry-author] on [entry-published] [entry-comments-link before=" | "] [entry-edit-link before=" | "]', 'path-child' ) . '</div>' ); ?>
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'my-life' ), 'after' => '</p>' ) ); ?>
- </div><!-- .entry-summary -->
- <?php echo apply_atomic_shortcode( 'entry_meta', '<div class="entry-meta">' . __( 'Views [entry-views] [entry-terms taxonomy="category" before="Posted in "] [entry-terms before="Tagged "]', 'path-child' ) . '</div>' ); ?>
- </div><!-- .hentry -->
- <?php endwhile; ?>
- <?php wp_reset_postdata(); // reset the query ?>
- <?php endif; ?>
- </div><!-- .hfeed -->
- <?php do_atomic( 'close_content' ); // my-life_close_content ?>
- <?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
- </div><!-- #content -->
- <?php do_atomic( 'after_content' ); // my-life_after_content ?>
- <?php get_footer(); // Loads the footer.php template. ?>
Advertisement
Add Comment
Please, Sign In to add comment