Using the include parameter with get_posts to order the posts
-
I’m modifying my homepage so that the posts that are displayed are determined by a custom field on the homepage. That field includes a comma-separated list of post IDs. I then pull the value of the custom field into a variable to create an ‘include=’ parameter for get_posts:
$homePostsIDs = get_post_meta(500, 'Home Posts', true); $argument = 'include='.$homePostsIDs'; $homePosts = get_posts($argument);
This works fine. But get_posts always sorts the array of posts. I want them to remain in the order specified in my custom field (and used in the ‘include’ parameter). Is this possible?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Using the include parameter with get_posts to order the posts’ is closed to new replies.