Created
August 5, 2014 16:43
-
-
Save mattbanks/66cd8c6dcbbccb34189e to your computer and use it in GitHub Desktop.
Awful loop usage in WordPress theme index.php
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 global $wp_query; | |
query_posts( | |
array_merge( | |
$wp_query->query, | |
array( | |
'orderby' => 'post_date', | |
'order' => 'desc' | |
) | |
) | |
); | |
?> | |
<?php if (have_posts()) : while (have_posts()) : the_post();?> | |
<div class="blogEntry"> | |
<div class="blogDate"> | |
<span class="blogMonth"><?php the_time('F'); ?></span> | |
<span class="blogDay"><?php the_time('j'); ?></span> | |
</div> | |
<a href="<?php the_permalink(); ?>"><h1 class="balance-text"><?php the_title(); ?></h1></a> | |
<?php the_content(); ?> | |
</div> | |
<?php endwhile; endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment