我有一个有趣的问题,我过去几天一直试图解决这个问题。我创建了第二个导航菜单,并通过将此代码添加到我的custom_functions.php中将其添加到Thesis 1.8.5的侧边栏中:
/* Add second menu to sidebar 1*/
register_nav_menu('secondary', 'Secondary Menu');
function secondary_menu() {
wp_nav_menu( array( 'container_class' => 'secondary_menu', 'theme_location' => 'secondary' ) );
}
add_action('thesis_hook_before_sidebar_1','secondary_menu');
然后我通过将此css添加到custom.css:
来创建菜单项的图标/* Menu Container */
.custom .sidebar .menu {
list-style: none;
padding: 0;
margin: 0 0 0 10px;
width: 190px;
height: 190px;
position: relative;
}
/* Submenu Container */
.custom .sidebar .sub-menu {
list-style: none;
padding: 0;
margin: 0;
width: 190px;
height: 45px;
position: relative;
}
/* Facebook */
.custom #menu-item-15470 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 0px;
top: 0px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0 0px;
}
.custom #menu-item-15470 a:hover {
background-position:-83px 0;
}
/* Pinterest */
.custom #menu-item-15471 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 91px;
top: -81px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -82px;
}
.custom #menu-item-15471 a:hover {
background-position:-83px -82px;
}
/* Instagram */
.custom #menu-item-15472 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 0px;
top: -71px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -165px;
}
.custom #menu-item-15472 a:hover {
background-position:-83px -165px;
}
/* Instagram Submenu Janae */
.custom #menu-item-15473 a {
display:block;
height:42px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 1px;
top: -72px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -331px;
}
.custom #menu-item-15473 a:hover {
position: relative;
left: 1px;
top: -72px;
background-position:-83px -331px;
}
/* Instagram Submenu Billy */
.custom #menu-item-15478 a {
display:block;
height:42px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 1px;
top: -75px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -374px;
}
.custom #menu-item-15478 a:hover {
background-position:-83px -374px;
}
/* Twitter */
.custom #menu-item-15475 a {
display:block;
height:81px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 91px;
top: -197px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -248px;
}
.custom #menu-item-15475 a:hover {
background-position:-83px -248px;
}
/* Twitter Submenu Janae*/
.custom #menu-item-15476 a {
display:block;
height:42px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 92px;
top: -198px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -417px;
}
.custom #menu-item-15476 a:hover {
background-position:-83px -417px;
}
/* Twitter Submenu Billy*/
.custom #menu-item-15479 a {
display:block;
height:42px;
width:80px;
padding:0px;
margin-left:0px;
position: relative;
left: 92px;
top: -201px;
outline:none;
text-indent:-9999px;
background-image:url("http://www.hungryrunnergirl.com/wp-content/uploads/2013/01/Social_Sprite.png"); background-position:0px -460px;
}
.custom #menu-item-15479 a:hover {
background-position:-83px -460px;
}
菜单图标在所有浏览器(包括移动设备)上都能正确显示,但在移动设备上却没有显示(只显示链接)。
应该如何看待:
http://farm9.staticflickr.com/8220/8340444170_7db7385bab_b.jpg
移动野生动物园的样子:
http://farm9.staticflickr.com/8072/8339388111_7bdc6f50a9_b.jpg
我正在处理的博客是www.hungryrunnergirl.com,如果你想亲自检查一下。
任何帮助将不胜感激。谢谢
答案 0 :(得分:0)
似乎工作正常。我正在使用iOS模拟器(Apple官方工具)。我试过iPhone和iPad。您是否遇到过缓存问题?