get_posts and custom field question
-
I have the following code that lists posts on a page:
<ul> <?php global $post; $myposts = get_posts(array('post__in' => array(46,30))); foreach($myposts as $post) : setup_postdata($post); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul>I would like the post id’s in the array section to be brought in from a custom field called “featured-posts”. So the site admin can add the id’s of the posts he would like to feature on the page. I’m certain this can be done but I’m unsure how to lay out the code. Any help would be greatly appreciated.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘get_posts and custom field question’ is closed to new replies.