[Resolved] Change tablet media query site-wide

Home Forums Support [Resolved] Change tablet media query site-wide

Home Forums Support Change tablet media query site-wide

  • This topic has 5 replies, 3 voices, and was last updated 3 years ago by Elvin.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1717845
    Marco

    Hi,
    I searched the forums but couldn’t find an answer which works. I would like to change the tablet breakpoint site-wide. It’s now at 1024px but I would rather have it at 1280px for example.

    I found

    add_filter( 'generate_media_queries', function( $queries ) {
        $queries['tablet'] = '(min-width: 769px) and (max-width: 1024px)';
        $queries['mobile'] = '(max-width:768px)';
    
        return $queries;
    } );

    But changing the 1024px here to 1280px doesn’t seem to work when putting this in the functions.php.

    Could you please help me?

    Regards,
    Marco

    #1718063
    David
    Staff
    Customer Support

    Hi there,

    can you share a link where you have added the filter with the 1280px size.

    #1718148
    Marco

    I’m working on a local server so that would not be possible unfortunately.

    I’ve put the code at the top in the functions.php of the child theme. Will that help?

    #1718441
    Elvin
    Staff
    Customer Support

    Hi there,

    Some media queries are hardcoded within the CSS file. For these, you’ll have to write custom CSS to override these hardcoded ones.

    #1725661
    Marco

    Thanks, I will look into it.

    #1725675
    Elvin
    Staff
    Customer Support

    No problem. 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.