Created
December 6, 2012 13:23
-
-
Save TheHeat/4224422 to your computer and use it in GitHub Desktop.
WordPress theme conditional copyright function.
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 function span_copyright($year = 'auto'){ | |
if(intval($year) == 'auto'){ $year = date('Y'); } | |
if(intval($year) == date('Y')){ echo intval($year); } | |
if(intval($year) < date('Y')){ echo intval($year) . ' - ' . date('Y'); } | |
if(intval($year) > date('Y')){ echo date('Y'); } | |
} ?> | |
<span class="copyright">© <?php span_copyright(); ?> - <?php echo get_bloginfo('name'); ?></span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment