由于上一篇文章的混淆和误解,我正在重新发布这篇文章。我正在尝试更改 WORDPRESS 网站上菜单项的颜色而没有运气。我联系了主题创建者,他说要在下面的代码中进行更改。 我不知道该怎么做!!! wordpress主题设置中有一个自定义换色器,但它无法更改菜单或标题(帖子或页面)颜色。 (我需要同时做两件事)请帮助.... 请注意,更改css也没有任何用处
<script type="text/javascript">
jQuery(document).ready(function($){
// Cufon font replacement & text shadows
Cufon.replace('#sidebar .font, #content .post .font, #card-container .font, #frontwidgets h3, #gallery .gal_item .font, #nicepagination .font',{ fontFamily: 'Junction', textShadow: '#fff 0px 1px' });
Cufon.replace('#footer .font',{ fontFamily: 'Junction', textShadow: '#000 0px -1px' });
Cufon.replace('#content .title-container .font, #mainmenu ul.menu li:not(.current_page_item, .current-menu-parent) a.font',{ fontFamily: 'Junction', textShadow: '#<?php echo $color->bg['-4']; ?> 0px -1px' });
Cufon.replace('#mainmenu ul.menu li.current-menu-item a.font, #mainmenu ul.menu li.current-menu-parent a.font',{ fontFamily: 'Junction', textShadow: 'none' });
// Fixing menu hovers as cufon can't seem to handle different div-hover colors
$('#mainmenu').find('ul.menu').children('li:not(.current-menu-item, .current-menu-parent)').hover(
function () {
Cufon.replace($(this).find('a.font'),{ fontFamily: 'Junction', color: '#<?php echo $color->bg['0']; ?>', textShadow: 'none' });
},
function () {
Cufon.replace($(this).find('a.font'),{ fontFamily: 'Junction', color: '#<?php echo $color->fg['-2']; ?>', textShadow: '#<?php echo $color->bg['-4']; ?> 0px -1px' });
}
);
});
</script>
这是我编辑过的css ......它什么也没做,只是哎呀
/* begin ---------------------------------------- menu */
#mainmenu {
position: absolute;
z-index: 10;
top: 81px;
width: 100%;
}
#mainmenu .wrapper {
position: relative;
width: 990px;
}
#menu-bg {
width: 990px;
height: 53px;
display: inline-block;
background: url('images/menu_bg.png') no-repeat;
}
#menu-left {
position: absolute;
top: 4px;
left: 0px;
height: 15px;
width: 15px;
background: url('images/menu_left.png') no-repeat;
}
#menu-right {
position: absolute;
top: 4px;
right: 0px;
height: 15px;
width: 15px;
background: url('images/menu_right.png') no-repeat;
}
#menu-container {
position: absolute;
top: 4px;
left: 15px;
width: 960px;
height: 43px;
display: inline-block;
background: url('images/patern_sharp.png');
float: left;
border-top: #000 1px solid;
border-bottom: 1px solid;
}
#mainmenu ul.menu {
position: absolute;
top: 0px;
left: 150px;
}
#mainmenu .dropdown_arrow {
height: 0px;
width: 0px;
position: absolute;
top: 19px;
right: 10px;
border-color: #fff transparent transparent transparent;
border-style: solid;
border-width: 5px;
}
#mainmenu ul.menu li.has-sub-menu:hover .dropdown_arrow, #mainmenu ul.menu li.has-sub-menu.current-menu-item .dropdown_arrow, #mainmenu ul.menu li.has-sub-menu.current-menu-parent .dropdown_arrow {
top: 21px;
}
#mainmenu ul.menu li {
float: left;
font-size: 14px;
padding: 15px;
margin: 0 3px;
display: inline-block;
position: relative;
}
#mainmenu ul.menu li.has-sub-menu {
padding-right: 30px;
}
#mainmenu ul.menu li a {
color: #fff;
}
#mainmenu ul.menu li:hover, #mainmenu ul.menu li.current-menu-item, #mainmenu ul.menu li.current-menu-parent {
background: #fff;
padding: 17px 14px 18px 14px;
margin: -3px 3px 0 3px;
border-top: #dedede 1px solid;
border-right: #dedede 1px solid;
border-left: #dedede 1px solid;
}
#mainmenu ul.menu li.has-sub-menu:hover, #mainmenu ul.menu li.has-sub-menu.current-menu-item, #mainmenu ul.menu li.has-sub-menu.current-menu-parent {
padding-right: 29px;
}
#mainmenu ul.menu li.has-sub-menu:hover {
padding-bottom: 24px;
}
#mainmenu ul.menu li ul.sub-menu {
position: absolute;
width: auto;
top: 55px;
left: -1px;
background: #fff;
display: none;
padding: 10px 0;
border-right: #dedede 1px solid;
border-bottom: #dedede 1px solid;
border-left: #dedede 1px solid;
}
#mainmenu ul.menu li:hover ul.sub-menu {
display: inline-block;
}
#mainmenu ul.menu li ul.sub-menu li {
clear: both;
height: auto;
width: 200px;
padding: 10px 15px;
margin: 0;
border: 0;
display: block;
}
#mainmenu ul.menu li ul.sub-menu li.current-menu-item, #mainmenu ul.menu li ul.sub-menu li:hover {
padding: 10px 15px;
margin: 0;
border: 0;
background: #eee;
}
#mainmenu ul.menu li:hover ul.sub-menu li a, #mainmenu ul.menu li ul.sub-menu li a {
padding: 0 10px 0 0;
display: block;
font-size: 13px;
height: auto;
}
#mainmenu ul.menu li a:hover, #mainmenu ul.menu li ul.sub-menu li a:hover {
text-decoration: none;
}
#stars-left {
background: url('images/stars.png') no-repeat;
position: absolute;
top: 20px;
left: 60px;
height: 13px;
width: 61px;
}
#stars-right {
background: url('images/stars.png') no-repeat;
position: absolute;
top: 20px;
right: 60px;
height: 13px;
width: 61px;
}
/* end ---------------------------------------- menu */
答案 0 :(得分:0)
Cufon似乎拥有类似CSS的东西:
Cufon.replace('#sidebar .font, #content .post .font, #card-container .font, #frontwidgets h3, #gallery .gal_item .font, #nicepagination .font',{ fontFamily: 'Junction', textShadow: '#fff 0px 1px' });
Cufon.replace('#footer .font',{ fontFamily: 'Junction', textShadow: '#000 0px -1px' });
Cufon.replace('#content .title-container .font, #mainmenu ul.menu li:not(.current_page_item, .current-menu-parent) a.font',{ fontFamily: 'Junction', textShadow: '#<?php echo $color->bg['-4']; ?> 0px -1px' });
Cufon.replace('#mainmenu ul.menu li.current-menu-item a.font, #mainmenu ul.menu li.current-menu-parent a.font',{ fontFamily: 'Junction', textShadow: 'none' });
尝试将CSS添加到这些功能中(我会尝试color
)。