Skip to content

Instantly share code, notes, and snippets.

@anwerashif
Created February 23, 2018 18:24
Show Gist options
  • Save anwerashif/fd5e6bf4e9c3f485b1c69262419e886e to your computer and use it in GitHub Desktop.
Save anwerashif/fd5e6bf4e9c3f485b1c69262419e886e to your computer and use it in GitHub Desktop.
Customize the footer section
<?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 = __(' &middot; <a href="https://rainastudio.com/">RainaStudio.com</a> &middot; 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