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-home.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
110 lines (80 sloc)
3.22 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: Home | |
*/ | |
get_header(); | |
$homepageLayout = get_theme_mod( 'homepagelayout','3-3'); | |
if($homepageLayout == '1-3') { | |
/* | |
Template Name: Homepage 1-3 | |
*/ | |
?> | |
<div id="home"> | |
<div class="row" id="row1"> | |
<div class="span12 home-loading" role="complementary"></div> | |
<div id="home1" class="span12" role="complementary"> | |
<?php if ( is_active_sidebar( 'home1' ) ) { ?> | |
<?php dynamic_sidebar( 'home1' ); ?> | |
<?php } else { ?> | |
<h1>Home1</h1> | |
<p>Go to Appearance > Widgets, and drag items into Home1 to edit this area.</p> | |
<?php }; ?> | |
</div> | |
</div> | |
<div class="row" id="row2"> | |
<div id="home2" class="span9" role="complementary"> | |
<h4> News</h4> | |
</div> | |
<div class="span3" role="complementary"> | |
<h6><a href="<?php bloginfo('template_url'); ?>/news-archive">More News »</a></h6> | |
</div> | |
</div> | |
<div class="row" id="row3"> | |
<div id="home3"> | |
<?php $args = array('category_name' => 'news-home', | |
'posts_per_page' => 3, | |
'orderby' => 'post-date'); | |
$posts = get_posts($args); | |
?> | |
<?php if ( !empty($posts) && isset($posts[0])) : foreach( $posts as $post ) : setup_postdata($post); ?> | |
<div class="span4 home-news" role="complementary"> | |
<div class="post-thumbnail-home"> | |
<a class="post-link" href="<?php the_permalink() ?>"> <?php the_post_thumbnail('large');?></a> | |
</div> | |
<div class="post-date-home"> | |
<?php the_time('F j, Y'); ?> | |
</div> | |
<div class="post-title-home"> | |
<a class="post-link" href="<?php the_permalink() ?>"><?php the_title(); ?></a> | |
</div> | |
<div class="post-content-home"> | |
<?php the_excerpt(); ?> | |
</div> | |
<div class="post-tags-home clear"> | |
<?php | |
$posttags = get_the_tags(); | |
if ($posttags) { | |
$include = array('humanities', 'life-behavioral-sciences', 'physical-sciences', 'social-sciences','centers-and-institutes'); | |
foreach($posttags as $tag) { | |
if(in_array($tag->slug,$include)){ | |
echo '<a href="';echo bloginfo(url); | |
echo '/news-archive/?division=' . $tag->slug . '" class="' . $tag->slug . '">' . $tag->name . '</a>'; | |
} | |
} | |
} | |
?> | |
</div> | |
</div> | |
<?php endforeach; ?> | |
<?php else: ?> | |
<p> | |
<?php _e('Sorry, no recent news.'); ?> | |
</p> | |
<?php endif; ?> | |
</div> | |
</div> | |
</div> | |
<?php | |
} | |
get_footer(); | |
?> |