Created
October 12, 2013 09:39
-
-
Save ejntaylor/6947974 to your computer and use it in GitHub Desktop.
Woo Canvas Blog Grid (based on Magazine Blog Grid)
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
<style> | |
/* Home - Blog Grid */ | |
.home-blog-grid article { | |
float: left; | |
width: 47%; | |
padding-right: 3%; | |
} | |
.home-blog-grid { | |
overflow-x: auto; | |
padding: 40px 40px 20px 40px; | |
} | |
</style> | |
<div class="home-blog-grid"> | |
<?php | |
// Use a custom query to display posts instead of the page content. | |
$page = get_query_var( 'page' ); | |
$paged = get_query_var( 'paged' ); | |
// Make sure we're on the correct page. | |
if ( ( $page > $paged ) ) { $paged = $page; } | |
// Run the query to get the posts. | |
query_posts( 'post_type=post&posts_per_page=4&suppress_filters=0&paged=' . $paged ); | |
if ( have_posts() ) { $count = 0; | |
while ( have_posts() ) { the_post(); $count++; | |
woo_get_template_part( 'content', get_post_type() ); // Get the page content template file, contextually. | |
} | |
} | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment