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?
clas/page-news-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.
171 lines (135 sloc)
6.31 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 | |
/* | |
Template Name: News Archive | |
*/ | |
get_header(); ?> | |
<div id="home-interior"> | |
<div class="row" id="row1"> | |
<div class="page-title clear"> | |
<h1>Archive</h1> | |
</div> | |
<div class="interior-hero clear"> | |
<?php the_post_thumbnail(); ?> | |
</div> | |
<div class="span3 news-archive-left"> | |
<strong><p>Sort By Division</p></strong> | |
<div class="post-tags-home news-tags clear"> | |
<a class="physical-sciences" href="#">Physical Sciences</a> | |
<a class="social-sciences" href="#">Social Sciences</a> | |
<a class="humanities" href="#">Humanities</a> | |
<a class="life-behavioral-sciences" href="#">Life & Behavioral Sciences</a> | |
<a class="centers-and-institutes" href="#">Centers & Institutes</a> | |
<a class="all-divisions" href="#">All Divisions</a> | |
</div> | |
<strong><p>Sort By Category</p></strong> | |
<div class="date-sort-button"> | |
<?php | |
$args = array( | |
'show_option_all' => 'All Categories', | |
'orderby' => 'NAME', | |
'taxonomy' => 'category', | |
'hide_empty' => 1, | |
'name' => 'news-sort-cat', | |
'exclude' => '149,10', | |
'class' => 'news-archive-dropdown category' | |
); | |
wp_dropdown_categories( $args ); | |
?> | |
</div> | |
<strong><p>Sort By Tag</p></strong> | |
<div class="date-sort-button"> | |
<?php | |
$args = array( | |
'show_option_all' => 'All Tags', | |
'orderby' => 'NAME', | |
'taxonomy' => 'post_tag', | |
'hide_empty' => 1, | |
'name' => 'news-sort-tag', | |
'class' => 'news-archive-dropdown tag' | |
); | |
wp_dropdown_categories( $args ); | |
?> | |
</div> | |
<strong><p>Sort By Date</p></strong> | |
<div class="date-sort-button clear"> | |
<a href="#" class="DESC">Newest<b class="caret caret-reversed"></b></a> | |
<a href="#"class="ASC">Oldest<b class="caret"></b></a> | |
</div> | |
<div | |
<form role="search" method="get" id="searchform" action=""> | |
<div> | |
<input type="text" value="" name="s" id="news-archive-search" placeholder="Search News Stories" /> | |
</div> | |
<div id="search-error" style="display:none"></div> | |
</form> | |
</div> | |
<hr /> | |
<div id="news-stories"> | |
<strong><p>News Stories</p></strong> | |
<ul class="news-archive-list"> | |
<?php | |
$args = array( 'posts_per_page' => -1, 'category_name' => 'archive' ); | |
$myposts = get_posts( $args ); | |
for ($i=0; $i < 9; $i++) { | |
next($myposts); | |
} | |
$tenthPostID = current($myposts)->ID; | |
$firstPostID = reset($myposts)->ID; | |
foreach ( $myposts as $post ) : setup_postdata( $post ); | |
?> | |
<li data-id="<?php echo $post->ID; ?>" data-slug="<?php echo $post->post_name ?>"> | |
<a href="<?php the_permalink(); ?>"><?php the_title();?></a> | |
</li> | |
<?php echo paginate_links( $args ); ?> | |
<?php endforeach; | |
wp_reset_postdata();?> | |
</ul> | |
<div class="pagination pagination-small" id="news-pagination"> | |
<ul> | |
<li><a href="#" id="news-back">«</a></li> | |
<li><a href="#" id="news-next">»</a></li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<?php | |
$args = array( 'numberposts'=> 10, 'orderby' => 'post-date', 'category_name' => 'archive'); | |
$latestpost = get_posts( $args ); | |
?> | |
<div class="span8 follow-hero"> | |
<span class="clas-taxonomy-type" style="display:none"></span><span class="clas-taxonomy-name" style="display:none"></span> | |
<?php | |
foreach ( $latestpost as $post ) : setup_postdata( $post ); | |
?> | |
<article data-id="<?php echo $post->ID ?>" class="article-block clearfix"> | |
<header class="entry-header"> | |
<h3 class="clas-entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> | |
<div class="clas-post-date"><?php the_time('F j, Y'); ?></div> | |
<?php | |
if( has_post_thumbnail() ){ | |
echo '<div class="archive-thumbnail">'.get_the_post_thumbnail($post->ID, 'medium').'</div>'; | |
} | |
?> | |
</header> | |
<div class="clas-entry-content"> | |
<?php | |
$excerpt = getPostExcerpt($post->ID); | |
echo $excerpt; | |
if( strlen($excerpt) > 7 ){ | |
echo '<p><a href="'.get_permalink($post->ID).'" class="read-more">Read More »</a></p>'; | |
} | |
?> | |
</div> | |
</article> | |
<?php | |
endforeach; | |
wp_reset_postdata(); | |
?> | |
<div class="story-navigation"> | |
<a href="#" id="newerStories" data-id="<?php echo $firstPostID; ?>">Newer Stories</a> | |
<a href="#" id="olderStories" data-id="<?php echo $tenthPostID; ?>">Older Stories</a> | |
</div> | |
</div> <!-- span8 follow-hero --> | |
</div> | |
</div> | |
<?php get_footer(); ?> |