我正在开发 Woocommerce Storefront 的儿童主题。
在平板电脑(纵向,768px 宽)上,我希望显示“移动”布局(汉堡菜单等),而不是桌面布局(主菜单等)。
我在我的 css 文件中使用了以下 css 媒体查询:
@media (max-width: 768px)
for mobile
@media (min-width: 769px)
for desktop。
但是店面的所有媒体查询似乎都激活了桌面布局@media (min-width: 768px)
。
如何更改此断点?
编辑 1:我尝试将文件 wp-content/themes/storefront/assets/sass/utils/_variables.scss 编辑为
$desktop: 769px;
$handheld: 768px;
但它不会改变布局。
编辑2:我在functions.php中试过这个
// Change Woocommerce css breaktpoint from max width: 768px to 767px
add_filter('woocommerce_style_smallscreen_breakpoint','woo_custom_breakpoint');
function woo_custom_breakpoint($px) {
$px = '769px';
return $px;
}
但它也不起作用。