Introduction

We certainly don’t make it a secret, we love Divi around here. Unfortunately, sometimes Elegant Themes might do things that we don’t like. The most recent such change is the removal of direct URLs for background images and videos. Well, thankfully we’ve found a way around that! And yes, this does restore direct URLs to background videos too.

 

Why We Need This Feature

I hope that Elegant Themes reads this message as well, because we really do need functionality like this, and I can’t understand why it was removed. We need the ability to input a direct URL for images and videos because we don’t all host our images and videos on our WordPress installation. For example, we use Dropbox Pro as a CDN, storing web content in a public folder and embedding it. This reduces server load dramatically, and increases the speed of our site. After all, why remove a feature that’s already there and used by so many?

 

How To Do It

If you’re not using a child theme for your site, now would be a really good time to start, because you’ll need it for this hack. Navigate to your child theme’s functions.php file, and add the following code:

Manual Method

add_action('admin_head', 'restore_divi_image_url');

function restore_divi_image_url() {
echo '<style>
.et_pb_background-tab--image .et-pb-option--has-preview .et-pb-upload-field, .et_pb_background-tab--image .et-pb-option--has-preview .et-pb-upload-button, .et_pb_background-tab--video .et-pb-option--has-preview .et-pb-upload-field, .et_pb_background-tab--video .et-pb-option--has-preview .et-pb-upload-button, .et_pb_background-tab--video .et-pb-option--has-preview .et-pb-reset-setting {
display:inline !important;
}
</style>';
}

Save the file, and that’s it, you’re done!

Plugin Method (New!)

I took the time to write a plugin to handle this for you. Simply install this plugin and get your URL field back!

Download As Plugin

 

How and Why This Works

If you look carefully, all that’s happening is adding a little CSS to the head of your admin pages. That’s because the feature existed all along, but for whatever reason is set to display:none; so as to render it invisible.  The good news is that this functions.php hack is completely harmless because of this, and won’t hurt your site no matter what future updates might come.  The bad news is that Elegant Themes could remove the feature for real in the future, and this won’t work.

 

Conclusion

Hopefully, Elegant Themes will be restoring this feature in the future, and this hack won’t be needed. There’s also the chance that this might not work on future updates. For now, enjoy!

Pin It on Pinterest