Site logo

Archived topic

Change tablet media query site-wide

5 replies · Started by Marco on April 1, 2021

Viewing posts 1–6 of 6

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

Hi there,

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

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?

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.

Thanks, I will look into it.

No problem. :)

This archived topic is closed to new replies.