This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
hri/archive.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
159 lines (119 sloc)
6.15 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
get_header(); | |
?> | |
<div id="body-container"> | |
<div class="custom-span8 clear"> | |
<div class="section-title text-serif">BLOG</div> | |
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> | |
<?php /* If this is a category archive */ if (is_category()) { ?> | |
<h1 class="page-title">Archive for the ‘<?php single_cat_title(); ?>’ Category</h1> | |
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?> | |
<h1 class="page-title">Posts Tagged ‘<?php single_tag_title(); ?>’</h1> | |
<?php /* If this is a daily archive */ } elseif (is_day()) { ?> | |
<h1 class="page-title">Archive for <?php the_time('F jS, Y'); ?></h1> | |
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?> | |
<h1 class="page-title">Archive for <?php the_time('F, Y'); ?></h1> | |
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?> | |
<h1 class="page-title">Archive for <?php the_time('Y'); ?></h1> | |
<?php /* If this is an author archive */ } elseif (is_author()) { ?> | |
<h1 class="page-title">Author Archive for <?php the_author(); ?> </h1> | |
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> | |
<h1 class="page-title">Blog Archives</h1> | |
<?php } ?> | |
<hr class="title-hr" /> | |
<div class="span8 no-marg-left"> | |
<div class="post content clearfix" id="post-<?php the_ID(); ?>"> | |
<div class="blog-squares-wrapper top-shim"> | |
<?php while (have_posts()) : the_post(); ?> | |
<div class="blog-story-preview"> | |
<div class="blog-story-image-container"> | |
<div class="blog-story-image"> | |
<?php the_post_thumbnail('large');?> | |
</div> | |
</div> | |
<div class="blog-story-preview-content"> | |
<h3><a href=" <?php the_permalink(); ?>"><?php the_title();?></a></h3> | |
<h4>BY <?php the_author(); ?> </h4> | |
<hr class="dotted-bottom" /> | |
<p class="archive-date"><img src="<?php bloginfo('template_url'); ?>/img/icon-calendar-green.png"/> <?php the_date(); ?> </p> | |
<ul> | |
<li><img src="<?php bloginfo('template_url'); ?>/img/icon-tag-green.png"/> | |
<?php the_category(', '); ?> </li> | |
</ul> | |
</div> | |
</div> | |
<?php endwhile; ?> | |
</div> | |
<div class="clear"></div> | |
<div class="blog-pagination"> | |
<?php | |
global $wp_query; | |
$big = 999999999; // need an unlikely integer | |
echo paginate_links( array( | |
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), | |
'format' => '?paged=%#%', | |
'current' => max( 1, get_query_var('paged') ), | |
'total' => $wp_query->max_num_pages, | |
'prev_text' => __('‹ Previous'), | |
'next_text' => __('Next ›'), | |
) ); | |
?> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="sidebar"> | |
<span class="search-form"><?php get_search_form(); ?></span> | |
<?php $sidebar = get_post_meta($post->ID, 'sidebar-a', true); | |
get_sidebar($sidebar); | |
?> | |
<h2 class="widget-title">Archives</h2> | |
<div class="panel-group" id="accordion"> | |
<?php $args = array ( | |
'type' => 'monthly', | |
'echo' => 0, | |
); | |
$archives = wp_get_archives( $args); | |
$archives = explode('</li>',$archives); | |
$year = 0; | |
foreach($archives as $archive){ | |
$newyear = substr($archive,-8,4); | |
if(!preg_match('/^\d{4}$/',$newyear)){ | |
continue; | |
} | |
if($year != $newyear){ | |
if($year != 0){ | |
echo '</div></div>'; | |
} | |
echo '<div class="panel panel-default"> | |
<div class="panel-heading"><p class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#'.$newyear.'">'.$newyear.'</a></p></div>'; | |
echo '<div id="'.$newyear.'" class="collapse'; | |
if($year == 0) echo ' in'; | |
echo '">'; | |
$year = $newyear; | |
} ?> | |
<?php | |
$archive = str_replace(' '.$year,'',$archive); | |
$archive = str_replace('<li>','',$archive); | |
echo '<div class="panel-body">'; | |
echo '<ul class="archive-list"><li>'.$archive.'</li></ul>'; | |
echo '</div>'; | |
} | |
echo '</div></div>'; | |
?> | |
</div> | |
<br /><br /> | |
<?php | |
$category = get_category_by_slug( 'blog' ); | |
$args = array ( | |
'title_li' => __( 'Blog Categories' ), | |
'hide_empty' => 0, | |
'use_desc_for_title' => 0, | |
'child_of' => $category->term_id | |
); | |
wp_list_categories( $args ); ?> | |
</div> | |
</div> | |
<?php //Extra div ?> | |
</div> | |
<?php get_footer(); ?> |