'day', 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'size' => 'sportspress-fit-medium', 'birthday_format' => 'birthday', 'show_player_birthday' => get_option( 'sportspress_player_show_birthday', 'no' ) == 'yes' ? true : false, 'show_staff_birthday' => get_option( 'sportspress_staff_show_birthday', 'no' ) == 'yes' ? true : false, 'link_players' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, 'link_staff' => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false, ); extract( $defaults, EXTR_SKIP ); $args = array( 'post_type' => array( 'sp_player', 'sp_staff' ), 'numberposts' => -1, 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'ASC', 'monthnum' => date( 'n' ), ); if ( $date == 'day' ) { $args['day'] = date( 'j' ); } if ( $date == 'week' ) { unset( $args['monthnum'] ); $args['date_query'] = array( array( 'month' => date( 'n' ), 'day' => date( 'j' ), ), array( 'month' => date( 'n', strtotime( '+1 day' ) ), 'day' => date( 'j', strtotime( '+1 day' ) ), ), array( 'month' => date( 'n', strtotime( '+2 days' ) ), 'day' => date( 'j', strtotime( '+2 days' ) ), ), array( 'month' => date( 'n', strtotime( '+3 days' ) ), 'day' => date( 'j', strtotime( '+3 days' ) ), ), array( 'month' => date( 'n', strtotime( '+4 days' ) ), 'day' => date( 'j', strtotime( '+4 days' ) ), ), array( 'month' => date( 'n', strtotime( '+5 days' ) ), 'day' => date( 'j', strtotime( '+5 days' ) ), ), array( 'month' => date( 'n', strtotime( '+6 days' ) ), 'day' => date( 'j', strtotime( '+6 days' ) ), ), array( 'month' => date( 'n', strtotime( '+1 week' ) ), 'day' => date( 'j', strtotime( '+1 week' ) ), ), 'relation' => 'OR', ); } $posts = get_posts( $args ); foreach ( $posts as $post ) { echo '\n"; }