WP-CodeBox插件的相关语法:
<pre lang="LANGUAGE" line="N" file="download.txt" colla="+">代码</pre>
lang="LANGUAGE":代码的语言,如ASP、PHP、Java等
file="download.txt":创建一个可下载的保存名称
line="N":开始行数
colla="+/-": ”+“表示展开,”-“表示收缩
官方介绍支持的语言:
abap, actionscript, ada, apache, applescript, asm,
asp, autoit,
bash, blitzbasic, bnf,
c, c_mac, caddcl, cadlisp, cfdg, cfm, cpp-qt,
cpp,
csharp,
css, d, delphi, diff, div, dos, dot, eiffel, fortran, freebasic, genero, gml, groovy, haskell,
html4strict, idl, ini, inno, io,
java,
java5,
javascript, latex, lisp, lua, m68k, matlab, mirc, mpasm,
mysql, nsis,
objc, ocaml-brief, ocaml, oobas,
oracle8, pascal, per,
perl, php-brief,
php, plsql,
python, qbasic,
rails, reg, robots,
ruby, sas, scheme, sdlbasic, smalltalk, smarty,
sql, tcl, text, thinbasic, tsql,
vb,
vbnet, vhdl, visualfoxpro, winbatch,
xml, xpp, z80
新建post或pages页面时插入代码,进入HTML编辑状态(一定要记住),插入相关代码,示例如下:
<pre lang="php">
<?php
function foo()
{
echo "Hello World!\n";
}
for ($i = 0; $i < 10 $i++)
{
foo();
}
?>
</pre>
效果如下: