I want to create a template for selecting 5 specific posts to be displayed on a WordPress page.
Essentially I must be able to query 5 exact posts to be displayed on a Wordpress Page using a WP page template and a custom filed to choose the exact 5 post ids.
EDIT: I have this code thanks to this site. But now I need to be able to add the page id array via custom field. Can this be done?
EDIT 2: Actually the code is not displaying the posts in the array, but rather the latest posts on the homepage. Hmmm.
<?php
$post_id = array(483,454,376);
$posts = get_posts( $post_id);
foreach( $posts as $post ) :
setup_postdata($post); ?>
// you can call use post data inside here like
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<a class="thumb" href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '" class="hthumb"'); ?></a><?php the_excerpt(45); ?><a href="<?php the_permalink(); ?>" class="more">Read More..</a><div style="clear:both;"></div>
<?php endforeach; ?>