小编Cra*_*ack的帖子

如何在wordpress中仅当屏幕宽度大于1682px时注册并显示第二个侧边栏?

我想为宽于 1682 像素的 destop/电视屏幕显示 336 像素宽度的第二个侧边栏(所有页面的左侧)。

\n

如果第二个侧边栏有自己的类,那么我可以使用媒体查询功能内的 {display: none;} CSS 标签隐藏它。

\n

目前,我的模板只有 1 个侧边栏,可以显示在右侧或左侧。目前它位于右侧。

\n

这个脚本已经存在于我的functions.php中

\n
\n/*-----------------------------------------------------------------------------------*/\n//  Register widgetized areas, including two sidebars and four widget-ready columns in the footer.\n//  To override skeleton_widgets_init() in a child theme, remove the action hook and add your own\n//  function tied to the init hook.\n/*-----------------------------------------------------------------------------------*/\n\nif ( !function_exists( \'skeleton_widgets_init\' ) ) {\n\nfunction skeleton_widgets_init() {\n        // Area 1, located at the top of the sidebar.\n        register_sidebar( array(\n        \'name\' => __( \'Posts Widget Area\', …
Run Code Online (Sandbox Code Playgroud)

php wordpress

1
推荐指数
1
解决办法
440
查看次数

标签 统计

php ×1

wordpress ×1