hsquareweb
4/26/2012 - 7:41 PM

WP: Pull Posts

WP: Pull Posts

<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>