Skip to content

Instantly share code, notes, and snippets.

@mattbanks mattbanks/index.php
Created Aug 5, 2014

Embed
What would you like to do?
Awful loop usage in WordPress theme index.php
<?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
You can’t perform that action at this time.