Created
October 2, 2017 18:11
-
-
Save dherbold/933b69a375a675a568d3ba0ef40bc69a to your computer and use it in GitHub Desktop.
ASU Standards wordpress theme bootstrap based home page layout.
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 Page | |
* | |
* @package asu-wordpress-web-standards-theme | |
*/ | |
get_header(); | |
$custom_fields = get_post_custom(); | |
?> | |
<div id="main-wrapper" class="clearfix"> | |
<div class="clearfix"> | |
<?php echo do_shortcode( '[page_feature]' ); ?> | |
<div id="content" class="site-content"> | |
<?php echo do_shortcode( '[asu_breadcrumbs]' ); ?> | |
<main id="main" class="site-main"> | |
<?php | |
while ( have_posts() ) { | |
the_post(); | |
get_template_part( 'content', 'page' ); | |
// If comments are open or we have at least one comment, load up the comment template | |
if ( comments_open() || '0' != get_comments_number() ) : | |
comments_template(); | |
endif; | |
} // end of the loop. | |
if (is_front) { ?> | |
<div style="background-color: #F1F1F1;"> | |
<div class="container"> | |
<h2 style="margin-bottom: 40px; margin-top: 0;">CAST News</h2> | |
<?php | |
$args = array( 'numberposts' => 3, 'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date"); | |
$postslist = get_posts( $args ); | |
echo '<ul id="latest_posts" style="list-style: none;">'; | |
foreach ($postslist as $post) : setup_postdata($post); ?> | |
<li> | |
<h3 style="margin-top: 0; font-size: 36px;"> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>"> <?php the_title(); ?></a> | |
</h3> | |
<?php if ( has_post_thumbnail()) : ?> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > | |
<?php the_post_thumbnail( 'thumbnail', array( 'class' => 'alignleft' ) ); ?> | |
</a> | |
<?php endif; ?> | |
<strong><?php the_date(); ?></strong> | |
<br /> | |
<?php the_excerpt() ?> | |
<div style="clear: both;"> </div> | |
</li> | |
<?php endforeach; ?> | |
</ul> | |
<?php } ?> | |
<a class="btn btn-primary btn-large" style="margin-top: 30px;" href="/about-cast/news/" alt="view all news items">View all news </a> | |
</div> | |
</div> | |
</main><!-- #main --> | |
</div> | |
</div><!-- #main --> | |
</div><!-- #main-wrapper --> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment