-
-
Save jenhuls/25f47fb3506d46ecb5e8b655736c5d1f to your computer and use it in GitHub Desktop.
[Shortcode to display copyright notice with current year] Mostly used with builder plugins #WordPress #shortcode
This file contains hidden or 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 | |
/** | |
* Shortcode to display copyright notice with current year | |
* @author Alain Schlesser ([email protected]) | |
* usage: <?php echo do_shortcode('[copyright]'); ?> | |
*/ | |
function as_shortcode_copyright() { | |
// generate output in the form of "(C) 2015 Greatest Blog Ever" | |
$copyright = '© ' . date( 'Y' ) . ' ' . get_bloginfo( 'name' ); | |
return $copyright; | |
} | |
// register as shortcode [copyright] | |
add_shortcode( 'copyright', 'as_shortcode_copyright' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment