How to Fetch Selected Post Titles by ID?
-
I want to fetch 5 post titles as a list, and they should be selected by ID.
I know how to fetch one single post title, I do that like this:
// The Query query_posts('p=52'); while (have_posts()) : the_post(); the_title (); echo "<br />"; endwhile; // Reset Query wp_reset_query();
I would like to select 5 titles by 5 different ID’s like so:
// The Query query_posts('p=52, 22, 32, 10, 16'); while (have_posts()) : the_post(); the_title (); echo "<br />"; endwhile; // Reset Query wp_reset_query();
How can I accomplish that?
It would be best if the ID’s were separated by a comma. Because they’re saved as a option in ONE row and I intend to fetch them, and then explode and implode them again separated by a comma.
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘How to Fetch Selected Post Titles by ID?’ is closed to new replies.