- —
diff --git a/page-experience-timeline.php b/page-experience-timeline.php index d44e5bc..c0244ef 100644 --- a/page-experience-timeline.php +++ b/page-experience-timeline.php @@ -2,7 +2,7 @@ /* * Template Name: Experience Timeline * / - + /** * The template for displaying all single posts and attachments * @@ -13,13 +13,13 @@ get_header(); ?> $endDate ) ? $endDate : $jEDate ); - return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) ); - } +function withinDates( $jSDate, $jEDate ) { + $endYear = date( 'Y' ); + $endDate = $endYear . '-12-31'; + $startDate = ( $endYear - 2 ) . '-01-01'; + $jEDate = ( ! $jEDate ) ? date( 'Y-m-d' ) : ( ( $jEDate > $endDate ) ? $endDate : $jEDate ); + return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) ); +} $args = array( 'post_type' => array( 'job', @@ -27,118 +27,118 @@ get_header(); ?> 'posts_per_page' => -1, ); $loop = new WP_Query( $args ); -?> + ?>