Skip to content

Instantly share code, notes, and snippets.

@masumskaib396
Created November 15, 2018 07:11
Show Gist options
  • Save masumskaib396/97f920b01d223cc72ac9a5a420ffd360 to your computer and use it in GitHub Desktop.
Save masumskaib396/97f920b01d223cc72ac9a5a420ffd360 to your computer and use it in GitHub Desktop.
if (is_day()) {
printf('%s', get_query_var('day'));
}elseif (is_month()) {
$month = get_query_var( 'monthnum' );
$month_object = DateTime::createFromFormat('!m',$month);
echo $month_object->format('F');
}elseif (is_year()) {
printf('%s-%s-%s', get_query_var( 'year','monthnum','day' ));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment