php编辑Cufon字体替换 [英] php edit for Cufon font replacement

查看:138
本文介绍了php编辑Cufon字体替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更改我网站上菜单项的颜色,但我不知道在哪里添加我想要使用的颜色代码#c3c3c3

I am trying to change the color of the menu items on my website but i don't know where in this to add the color code #c3c3c3 that i want to use

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

***注意这是一个wordpress主题,由cufon替换字体,它取代了css所以当我这样做时改变css什么都不做

***NOTE this is a wordpress theme with font replacement by cufon and it replaces whatever is in the css so changing the css does nothing when i do it

推荐答案

你的代码表明主题可能从数据库中获取颜色,意味着主题作者可能很容易通过WordPress仪表板编辑这些颜色,所以选择1是围绕管理部分查看这些选项。

Your code indicates that the theme probably fetches the colors from database, which means theme author probably made it easy for you to edit these colors via WordPress dashboard, so choice 1 is look around the admin part for these options.

另一方面,你可以用一种快速(但完全有效)的方式来做,只需编辑代码的这一部分:

On the other hand, you can do it in a quick'n dirty (but perfectly valid) way, simply edit this part of your code:

<?php echo $color->bg['0']; ?>

<?php echo $color->bg['-4']; ?>

简单地用颜色代码替换它,比如FFFFCC或FF0000(前面不需要# ,因为这些已经存在,你会看到)

replacing it simply by color codes, like FFFFCC, or FF0000 (no need for # in front of it, as these are already in place as you'll see)

这篇关于php编辑Cufon字体替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆