Last active
September 16, 2022 01:29
-
-
Save wpgaurav/fe9b9a11e784ca50f988666488de8635 to your computer and use it in GitHub Desktop.
New shortcode [seomonth] that renders next month from 21st of this month
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// you can change 20 on line #8 to any date between 1 to 27 | |
add_shortcode( 'seomonth' , 'gtrmd_seomonthyear' ); | |
function gtrmd_seomonthyear() { | |
$gtseomonthyear1 = date_i18n("F"); | |
$gtseomonthyear2 = date("F", strtotime ( '+1 month' , strtotime ( $gtseomonthyear1 ) )) ; | |
$gtdtseocheck = date("j"); | |
if($gtdtseocheck > 20){ | |
return "$gtseomonthyear2"; | |
} else{ | |
return "$gtseomonthyear1"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment