Created
January 17, 2014 19:38
-
-
Save emaildano/8480006 to your computer and use it in GitHub Desktop.
Grab the most recent post from a category. This example is from Griggstown farm.
This file contains hidden or 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, 'category_name' => 'food-of-the-week' ); | |
$postslist = get_posts( $args ); | |
foreach ($postslist as $post) : setup_postdata($post); ?> | |
<h4><?php the_time('D, F jS, Y') ?></h4> | |
<h3><?php the_title(); ?></h3> | |
<p><?php echo bm_better_excerpt(431, ' ... ') ?></p> | |
<a href="<?php the_permalink(); ?>">Learn More</a> | |
<?php endforeach; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment