Select Page

As a developer or a website owner, you may want to change the footer to remove the standard Elegant Themes copyright notice, and place your own notice. If you do not want to add a dynamic year, it is easy enough to just edit the text in the Theme Customizer by editing the Footer->Bottom Bar->Edit Footer Credits field.

However, you may want to take it a step further and add a dynamic year or other customized html, css, or php elements. There are two options for doing this:

Option One

The easiest way to use a dynamic year in your Divi Footer copyright section is to use a small Javascript code snippet. Divi makes that super easy. Here’s how:

Navigate to Divi->Theme Options in your dashboard.

Paste the following code under the “Integration” tab in the header code section.

<script>
 var beg_year = 2017; // Year site went live
 var this_year = new Date(); // Get current date
 var developed_by = ' | Powered by <a href="https://yourdomain.com" target="_blank">Your Development Company</a>'; // Developer info
 this_year = this_year.getFullYear();
 if(this_year > beg_year) {
 var year = beg_year + ' - ' + this_year;
 } else {
 var year = this_year;
 }
 var domain = window.location.hostname;
 jQuery(function($){
 $('#footer-info').html('&copy; ' + year + '. ' + domain + '.' + developed_by );
 });
</script>

 

Obviously you are going to want to use your domain and text to specialize the output for your needs.

After you have clicked “Save” in the Divi Theme Options panel, return to the front-end of your website, and you will notice that the footer has been updated.

Option Two
(Caution: This method involves editing PHP code in the theme’s functions.php file. Editing this file requires a certain level of experience, and can cause your WordPress site to crash if done improperly. Fixing any mistakes will require knowledge of PHP and FTP.)

A more advanced, but an arguably better option, is to create a child theme for Divi, and edit the child theme’s function.php file.

I am not going to delve too much into creating a child theme in this article. There are dozens of ways to accomplish it, but I would suggest utilizing one of the plugins in the WordPress repository. A child theme is very important because it is the only way your changes will remain after Divi updates in the future.

After you have a child theme setup, you will login to your WordPress dashboard and navigate to the Appearance->Editor.

Once on the editor screen, ensure that your child theme is selected in the “Select a theme to edit” drop down towards the top right of your screen. Now look at the list of theme files on the right side, and click on “functions.php”.

At the bottom of your functions.php file, include the following function, editing the function as needed to display your information.

function et_get_footer_credits() {
  $site_title = get_bloginfo( 'name' );
  $developed_by = ' | Powered by <a href="https://yourdomain.com" target="_blank">Your Development Company</a>'; // Developer info
  $terms = '<br><a href="/privacy-policy">Privacy Policy</a> | <a href="/terms-and-conditions">Terms and Conditions</a>'; // Privacy and Terms of Condition links (comment to remove)
  $beg_year = 2017;
  $cur_year = intval(date('Y'));
  if($cur_year > $beg_year) {
    $display_year = $beg_year . ' - ' . $cur_year;
  } else {
    $display_year = $cur_year;
  }
  $footer_credits = '&copy; ' . $display_year . '. ' . $site_title .' .' . $developed_by . $terms;
  $credits_format = '<%2$s id="footer-info">%1$s</%2$s>';

  return et_get_safe_localization( sprintf( $credits_format, $footer_credits, 'div' ) );
}