Wrap group of wp query posts to parent div by date/year

This cannot be done only by querying database. Firstly, you have to iterate through all items and create array of posts grouped by dates. $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘event’, ‘meta_key’ => ‘event_date’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’ ); $wpquery = new WP_Query($args); $posts = $wpquery->get_posts(); $ordered_posts = array(); foreach ($posts … Read more

complex query question

It’s pretty easy actually in your single-event.php file within the content loop. add this loop where you want your speakers information to show. $event_title = get_the_title(); // This is the title of the current single event page we are on. $args = array( ‘meta_key’ => ‘event_name’, // the name of your custom field ‘meta_value’ => … Read more