WordPress Shortcode for Website Credits

WordPress Tips

Most themes handle notices in the footer quite well. We like to add custom items where necessary. Below you will see 2 options you can use to add a website credits shortcode to your website.

To use one of them, add one to your child theme’s function.php file or create a custom plugin file if you don’t wish to use a child theme.

Create Shortcode for Site Copyright Notice

This will add a shortcode to use to display your site’s copyright notice. It doesn’t need customization, but feel free to change it to fit your needs.

// Shortcode for Site Copyright
function site_copyright_shortcode() {
    return '&copy; ' . date("Y") . ' <a href="' . get_bloginfo('url') . '" title="&copy; ' . date("Y") . ' ' . get_bloginfo('name') . '">' . get_bloginfo('name') . '</a>. All rights reserved.';
}
add_shortcode('site-copyright', 'site_copyright_shortcode');

You call this shortcode by inserting [site-copyright] into your theme builder, footer, post, article, or other custom content areas. If you want to insert this into a child theme, use the function itself, instead of calling the shortcode.

Change Original Divi Footer Credits

Instead of using a shortcode for displaying copyright notice or credits, we like to use this custom footer credits function.

These changes will override the default footer information or the custom footer information changed in the theme customizer. Change the content or the order to your needs.

// Change Footer to Custom Credits or Affiliate Links
function et_get_original_footer_credits() {
	return sprintf( __( 'Created by %1$s. Created with %2$s. ' ), '<a href="#" title="Creator" target="_blank" rel="noopener noreferrer nofollow">Creator</a>', '<a href="#" title="Theme" target="_blank" rel="noopener noreferrer nofollow">Theme</a>' ) . ' &copy; ' . date("Y") . ' <a href="' . get_bloginfo('url') . '" title="&copy; ' . date("Y") . ' ' . get_bloginfo('name') . '">' . get_bloginfo('name') . '</a>. All rights reserved.';
}

For other themes, change the et_get_original_footer_credits() function to your theme’s footer credit function. The functionality should be similar, if not the same.