2015-12-23 60 views
0

我想在我的wordpress博客中整合Syntax Highlighter。我已經通過互聯網搜索了它,但沒有得到答案。如何在wordpress上安裝語法高亮器?

我試圖通過將博客寫作模式從可視化切換到html鏈接到sytax熒光筆,但它仍然不起作用。

有答案,它說,這不能自由WordPress博客做,但最近我參觀了這個博客:

tausiq.wordpress.com/2013/01/19/android-input-field-validation/

此博客已完成此任務。我想知道這是可能的。

回答

1

你也可以編輯你當前模板header.php文件。包含語法突出顯示器js和css文件。

包含後,請在帖子/頁面內容編輯器頁面(HTML模式)上使用<pre class="brush:php;"><?php echo 'Your example code'; ?></pre>代碼。

<!--SYNTAX HIGHLIGHTER BY MBT STARTS--> 
<link href='http://alexgorbatchev.com/pub/sh/2.1.382/styles/shCore.css' rel='stylesheet' type='text/css'/> 
<link href='http://alexgorbatchev.com/pub/sh/2.1.382/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shCore.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushCpp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushCSharp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushCss.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushJScript.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushPhp.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushPython.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushRuby.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushSql.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushVb.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushXml.js' type='text/javascript'/> 
<script src='http://alexgorbatchev.com/pub/sh/2.1.382/scripts/shBrushPerl.js' type='text/javascript'/> 
<script language='javascript'> 
SyntaxHighlighter.config.bloggerMode = true; 
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/2.1.382/scripts/clipboard.swf&#39;; 
SyntaxHighlighter.all(); 
</script> 
<!--SYNTAX HIGHLIGHTER BY MBT ENDS-->