Worspress SyntaxHighlighter代码着色

wordpress有插件,但是我们一般都是用wlw来写文章,所以还得用wlw的插件:

wlw插件下载地址即配置说明:http://wlwsyntaxhighlighter.codeplex.com/

测试一下:

<?php
echo "hello world";	
?>

步骤是安装wlw插件,

wlw同步主题:日志/编辑日志设置/编辑/刷新主题

然后将https://code.google.com/p/syntaxhighlighter中的资源上传到你的wp中,还要在你的主题中添加代码:

<link type="text/css" rel="stylesheet" href="Styles/SyntaxHighlighter.css"></link>
<script language="javascript" src="Scripts/shCore.js"></script>
<script language="javascript" src="Scripts/shBrushCSharp.js"></script>
<script language="javascript">
window.onload = function() {
    dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
    dp.SyntaxHighlighter.HighlightAll('code');
};
 </script>

稍微有点麻烦。

 


Total views.

© 2013 - 2024. All rights reserved.

Powered by Hydejack v6.6.1