Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="mpostfeed <?php echo $req_year.'-'.$req_month.'-'.$req_day;?>-archives archive-template" >
- <header class="header">
- <h1 class="mp-main-title"><?php
- if ( is_day() ) { printf( __( 'Daily Archives: %s', 'Evyr2014' ), get_the_time(get_option('date_format') ) ); }
- elseif ( is_month() ) { printf( __( 'Monthly Archives: %s', 'Evyr2014' ), get_the_time('F Y') ); }
- elseif ( is_year() ) { printf( __( 'Yearly Archives: %s', 'Evyr2014' ), get_the_time('Y') ); }
- else { _e( 'Archives', 'Evyr2014' ); }
- ?></h1>
- </header>
- <ul>
- <?php
- /*--------------------------------------------------------------------
- --Set up the arguments for the query, including the paginated aspect--
- --------------------------------------------------------------------*/
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- evyr2014_date_from_url();
- global $req_day, $req_month, $req_year, $the_query;
- if($req_day & $req_month & $req_year){
- $args = array(
- 'post_type' => 'post',
- 'cat' => '-14',
- 'date_query' => array(
- array(
- 'day' => $req_day,
- 'year' => $req_year,
- 'month'=> $req_month,
- )
- ),
- 'posts_per_page' => 10,
- 'paged' => $paged
- );
- }elseif(empty($req_day)){
- $args = array(
- 'post_type' => 'post',
- 'cat' => '-14',
- 'date_query' => array(
- array(
- 'year' => $req_year,
- 'month'=> $req_month,
- )
- ),
- 'posts_per_page' => 10,
- 'paged' => $paged
- );
- }else{
- $args = array(
- 'post_type' => 'post',
- 'cat' => '-14',
- 'date_query' => array(
- array(
- 'month'=> $req_month,
- )
- ),
- 'posts_per_page' => 10,
- 'paged' => $paged
- );
- }
- /*-------------------------------------------------
- --Retrieve the query based on the above arguments--
- -------------------------------------------------*/
- $the_query = new WP_Query( $args );
- if ( $the_query->have_posts() ) :
- while ( $the_query->have_posts() ) : $the_query->the_post();
- /*---------------------
- --Begin the post item--
- ---------------------*/
- ?>
- <li class="post-item">
- <a href="<?php echo the_permalink();?>">
- <span class="featured-bg">
- <?php
- if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
- the_post_thumbnail();
- }else{ ?>
- <span class="fp-holder"></span>
- <?php }
- ?>
- </span>
- </a>
- <a href="<?php echo get_permalink();?>" class="mp-title"><?php the_title();?></a>
- <span class="mp-excerpt"><?php the_excerpt();?></span>
- <span class="mp-panel">
- <span class="mp-date">
- <?php
- /*--------------------------------------------------
- --Sets up the Date in [Month] [Day], [Year] Format--
- --------------------------------------------------*/
- the_time('F d, Y');
- ?>
- </span>
- <span class="mp-postcount">
- <?php
- /*--Retrieve the post view count for the designated post--*/
- echo getPostViews(get_the_ID());
- ?>
- </span>
- <a href="<?php echo get_permalink();?>" class="mp-readmore">Read More</a>
- <span class="divider"></span>
- </span>
- </li><!--/.post-item-->
- <?php
- ?>
- <?php endwhile; ?>
- </ul>
- <?php
- get_template_part('assets/parts/feed', 'pagination');
- /*---------------------------------
- --Reset the arguments and query,---
- --So that multiple queries may be--
- --set up in a template-------------
- ---------------------------------*/
- wp_reset_postdata(); ?>
- <?php else:
- //Do Nothing
- endif; ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement