Viewing 1 replies (of 1 total)
  • Theme Author ronangelo

    (@ronangelo)

    You can use css to change the header image if you want to be able to set it at a specific screen resolution. (Use on a child theme style.css)

    Ex. For screen sizes 840px and below.

    @media screen and (max-width:840px){
       .body #header {
          background-image: url('http://example.com/image.jpg');
       }
    }

    You can also make use of when WordPress detects that it is being viewed on a mobile device. (Function to be used on a child theme functions.php)

    add_filter( 'theme_mod_header_image', 'custom_mobile_header_image' );
    
    function custom_mobile_header_image( $url ) {
       if ( wp_is_mobile() ) {
          $url = 'http://example.com/image.jpg';
       }
       return $url;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Different header background for mobile’ is closed to new replies.