Created
April 26, 2012 19:41
-
-
Save hsquareweb/2502448 to your computer and use it in GitHub Desktop.
WP: Pull Posts
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
<ul> | |
<?php global $post; | |
$args = array( 'numberposts' => 4, 'category' => 6, 'orderby' => 'post_date', 'post_status' => 'publish' ); | |
$myposts = get_posts( $args ); | |
foreach( $myposts as $post ) : setup_postdata($post); ?> | |
<li> | |
<div class="cal"> | |
<span class="month"><?php the_time('M'); ?></span> | |
<span class="day"><?php the_time('j'); ?></span> | |
</div> | |
<p> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a><br/> | |
<?php echo get_post_meta($post->ID, 'Event Date', true); ?><br/> | |
<?php echo get_post_meta($post->ID, 'Event Place', true); ?><br/> | |
<?php echo get_post_meta($post->ID, 'Event Location', true); ?> | |
</p> | |
</li> | |
<?php endforeach; ?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment