Change Logo on Mobile – Divi Theme

TIPS

Jun 27, 2018 | Divi Tips | 0 comments

If you want to add a different logo to your header for different screen resolutions, you can use the code below. Change the URLs to point to your images. You can also adjust the width value to whatever you like.

[php]<script>
jQuery( document ).ready(function() {
if(jQuery(window).width() < 481){
jQuery(‘#logo’).attr(‘src’,’https://www.yoursite.com/wp-content/uploads/yourlogo.jpg’);
}else if(jQuery(window).width() > 480){
jQuery(‘#logo’).attr(‘src’,’https://www.yoursite.com/wp-content/uploads/yourlogo-2.jpg’);
}
});
</script>
[/php]

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

More Tips

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

Cloudways Hosting

WPEngine Hosting

Pressable Hosting

AccuWeb Hosting

Ask the Divi Guy a Question

"*" indicates required fields