Change Logo on Mobile – Divi Theme

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.

<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>

0 Comments

Submit a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.