重新发布此....php 编辑 Cufon 字体替换

发布于 2024-11-14 07:53:01 字数 5543 浏览 5 评论 0原文

可能的重复:
Cufon 字体替换的 PHP 编辑

由于混乱和误解,我重新发布此内容上一篇文章的。我正在尝试更改 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 */

Possible Duplicate:
php edit for Cufon font replacement

I am reposting this due to the confusion and misconceptions of the previous post. I am trying to change the color of the menu items on my WORDPRESS website with no luck. I contacted the themes creator and he said to make the changes in the below code. I DONT SEE WHERE TO DO THIS THOUGH!!! There is a custom color changer in the wordpress theme setting but it does not have the ability to change menu or title (post or page) colors. (and i need to do both ) please help....note that changing the css also has availed nothing

<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>

Here is the css that i edited...it did nothing but what the heck

/* 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 */

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青柠芒果 2024-11-21 07:53:01

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)。

Cufon seems to have it's own CSS-like thing:

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' });

Try adding your CSS into those functions (I'd try color).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文