安裝 syntaxhighlighter plugin

syntaxhighlighter plugin 可以將程式碼放在wordpress文章中
下載後先解壓縮再將目錄放在wp-content/plugins
控制台啟用plugin即可
###120110
語法
[語言標籤 參數] 內文 [/語言標籤]
常用參數

gutter (true/false) — If false, the line numbering on the left side will be hidden. Defaults to true.

highlight (comma-seperated list of numbers) — You can list the line numbers you want to be highlighted. For example “4,7,19″.

htmlscript (true/false) — If true, any HTML/XML in your code will be highlighted. This is useful when you are mixing code into HTML, such as PHP inside of HTML. Defaults to false and will only work with certain code languages.

light (true/false) — If true, the gutter (line numbering) and toolbar (see below) will be hidden. This is helpful when posting only one or two lines of code. Defaults to false.

參考文章:
Posting Source Code

This entry was posted in wordpress and tagged . Bookmark the permalink.