Created
February 23, 2018 18:24
-
-
Save anwerashif/fd5e6bf4e9c3f485b1c69262419e886e to your computer and use it in GitHub Desktop.
Customize the footer section
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 | |
// Do NOT include the PHP opening tag | |
// Customize the footer section | |
add_filter('genesis_footer_creds_text', 'bdfg_footer_creds_text'); | |
function bdfg_footer_creds_text($creds) { | |
global $wpdb; | |
$table = $wpdb->prefix . 'posts'; | |
$lastDate = date('Y'); | |
$firstDate = $wpdb->get_var("SELECT YEAR(post_date) FROM $table ORDER BY post_date LIMIT 1"); | |
$text = __(' · <a href="https://rainastudio.com/">RainaStudio.com</a> · Built on <a href="http://wordpress.org">WordPress</a>', 'genesis'); | |
if($lastDate == $firstDate) $creds = "Copyright ©$firstDate-$lastDate " .$text; | |
else $creds = "Copyright ©$firstDate-$lastDate" .$text; | |
return $creds; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment