douhuai2015 2016-08-09 09:03
浏览 65

使用PHP更改链接样式

Im trying to change the link colours in my header section in wordpress but the below code isn't working....any ideas?

//Change link colours
add_action('wp_head', 'insert_some_css');

 function insert_some_css() { 
 echo <style type="text/css">
 a {
    color: #08FF00; /* green */
    text-decoration: none;
}
a:hover {
    color: #FF0000; /* red */
    text-decoration: underline;
}
</style>
}
  • 写回答

3条回答 默认 最新

  • dtdvbf37193 2016-08-09 09:06
    关注
    <?php
    add_action('wp_head', 'insert_some_css');
    
    function insert_some_css() {
        echo "<style type=\"text/css\">
            a {
                color: #08FF00; /* green */
                text-decoration: none;
            }
            a:hover {
                color: #FF0000; /* red */
                text-decoration: underline;
            }
            </style>";
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员