Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WP: Get Posts Query Loop
<?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
You can’t perform that action at this time.