Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// the query
$args = array(
'post_type' => 'post',
'posts_per_page' => 1,
$the_query = new WP_Query( $args ); ?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h2><?php the_title(); ?></h2>
<h2 class="title entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></h2></a></header>
<div class="post-meta"><abbr class="date time published updated" ><?php the_date(); ?></abbr></div>
<section class="entry">
<?php the_content(); ?>
</section><!-- /.entry -->
<div class="fix"></div>
<div class="post-more">
<span class="read-more"><a href="<?php the_permalink(); ?>" title="Continue Reading">Continue Reading</a></span> </div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php _e( 'Sorry, no posts.' ); ?></p>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment