Created
March 23, 2018 15:52
-
-
Save halgatewood/a0a1dab73f230b5c6496334c60db2ad1 to your computer and use it in GitHub Desktop.
Creating weather background images based on day and night using the 24 hour clock. Requires new images for the night time.
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
function hg_awesome_weather_bg_ext() | |
{ | |
// 24 HOUR CLOCK: | |
// LESS THAN 8 AM OR GREATER THAN 9 PM | |
if( get_the_time('G') < 8 || get_the_time('21') > 9 ) | |
{ | |
return "night.jpg"; | |
} | |
return "jpg"; | |
} | |
add_filter('awesome_weather_bg_ext', 'hg_awesome_weather_bg_ext'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment