Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #963525
    #963531

    And you really want a different logo for mobile devices ( ipad, iphone, smartphones, tabletts etc) and not a logo for smaller screens?

    #963535

    i think your code is correct – anyway you can test this in your functions.php of your child-theme:

    function avia_custom_mobile_logo(){
    if(wp_is_mobile()){
    ?>
     <script>
    	jQuery(".logo img").attr("src", "https://www.domain.com/wp-content/uploads/logo-for-mobile.png");
     </script>
    <?php
    }
    }
    add_action('wp_footer', 'avia_custom_mobile_logo');

    or with the filter :

    add_filter('avf_logo','mobile_logo_url');
    function mobile_logo_url($url){
        if(wp_is_mobile()){
            $url = "https://www.domain.com/wp-content/uploads/logo-for-mobile.png";
        }
        return $url; 
    }
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.