Skip to content

Instantly share code, notes, and snippets.

@NickToye
Last active December 14, 2015 01:18
Show Gist options
  • Save NickToye/5004846 to your computer and use it in GitHub Desktop.
Save NickToye/5004846 to your computer and use it in GitHub Desktop.
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* For example, it puts together the home page when no home.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php query_posts( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<div class="date">
<p><span class="month"><?php the_time('F') ?></span>
<span class="day"><?php the_time('j') ?></span>
</p>
</div>
<?php the_excerpt(); ?>
</article>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php query_posts( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment