Created
March 12, 2014 00:15
-
-
Save lelandsmith/9497912 to your computer and use it in GitHub Desktop.
WP: Get Posts Query Loop
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 | |
$args = array( 'numberposts' => 1, 'offset'=> 2, 'category' => 19 ); | |
$lastposts = get_posts( $args ); | |
foreach($lastposts as $post) : setup_postdata($post); ?> | |
<h2 style="font-size: 26px;"><a href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a></h2> | |
<?php the_time('F jS, Y') ?> | <?php the_author_link(); ?> | <a href="<?php the_permalink(); ?>/#respond" title=""><?php comments_number('0'); ?></a> | |
<div class="copy"> | |
<?php the_excerpt() ;?> | |
</div> | |
<?php endforeach; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment