I have 3 categories: Travel, Destination and Tips. I've been trying to get the latest post from each categories then put them into an array. Here's what I have in mind.
//GET CATEGORIES //I have this code but this only selects one category $args = array ( 'post_per_page' => 1, 'cat' => 16 ); //SELECT THE LATEST POST FROM EVERY CATEGORY //This part I don't know what to do. //GET ID OF THE POST SO THAT I CAN ADD IT TO THE ARRAY $post = array(); <-- This should contain every latest post from the categories. $post = get_post( /*ID OF THE POST SHOULD BE HERE*/ );
What I want to achieve is to have the id's of the latest posts from every category in the array. Please help. Thank you.