Display only upcoming events / Show all events when archive year is selected

Replace $today = date(‘Ymd’) with $hour = 0; $minute = 0; $second = 0; $month = (is_month()) ? get_the_date(‘m’) : 1; $day = (is_day()) ? get_the_date(‘d’) : 1; $year = get_the_date(‘Y’); $timestamp = mktime($hour, $minute, $second, $month, $day, $year); $search_date = date(‘Ymd’, $timestamp); // echo $search_date; In your query, replace ‘value’ => $today, with ‘value’ … Read more

I have 3 categories, i want to display on a loop the last 3 of every category

If you dont have the same post with more than 1 category, you can do: $args = array( ‘cat’ => $category->term_id, ‘post_type’ => ‘post’, ‘posts_per_page’ => ‘3’, ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { ?> <section class=”<?php echo $category->name; ?> listing”> <h2>Latest in <?php echo $category->name; ?>:</h2> <?php while ( … Read more