简体   繁体   English

移动版和桌面版网站的不同菜单

[英]Different menus for mobile and desktop version of site

I have one page in desktop version. 我的桌面版只有一页。 I need to divide it into two pages for mobile version. 我需要将其分为移动版的两个页面。 I thought about making this pages with the cms (I'm using Wordpress) and add to the links in menu bootstrap classes hidden . 我考虑过使用cms(我正在使用Wordpress)制作此页面,并将其添加到菜单bootstrap class hidden的链接中。

Is it possible to make a check box or something else to mark pages which must be hidden in desktop version? 是否可以选中一个复选框或其他方式标记必须在桌面版本中隐藏的页面?

An option here is to create two menus, one for the desktop version and one for the mobile version. 这里的一个选项是创建两个菜单,一个用于桌面版本,一个用于移动版本。 There are a conditional tag in wordpress called wp_is_mobile() which you can use to display the menus conditionally. 在wordpress中有一个名为wp_is_mobile()的条件标签,您可以使用该标签wp_is_mobile()地显示菜单。 You can try something like 您可以尝试类似

if(wp_is_mobile()) {
    //display mobile menu
}else{
   //display desktop menu
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM