How to use the highlighted plug-in of WP syntax WordPress


First of all, we have a brief understanding of the WP syntax plug-in. WP syntax is a code highlighting plug-in for WordPress. The biggest advantage is that it is easy to use and has good compatibility.

How to use WP syntax plug-in
First, go to WordPress to download the WP syntax plug-in. Click here to download!

After downloading, unzip, install and activate. The process will not be repeated.

For the following operations, we need to add the WP syntax plug-in to the WordPress article editor (this step is optional, and friends who are familiar with code operation can skip it). In this way, it is not necessary for us to manually input the code every time, which is very convenient. Find the file \ WP includes \ JS \ quicktags.js, and then download the garden at the bottom of this page to provide the modified file coverage of quicktags.js, refresh the background page, and switch to code mode when editing the article, you can see an additional “syntax” button.

If you want to add CSS code, select the code after entering the corresponding CSS code, then click the “syntax” button, and enter the corresponding language such as “CSS” in the pop-up window, so we can see the effect of code highlighting after publishing the article.

The highlighted code of WP syntax code is written in the following format:

Copy code

The code is as follows:

< pre lang=”html” line=”1″>
Here is the relevant code…
< /pre>

The above is the demonstration code. Please remove the space before pre when using. If you don’t want to display the line number, just remove “line =” 1 “!

Friendly tip: the code highlighting effect must be implemented in the code editor, that is, the pasted code must be in the code editor, and do not switch back and forth between the code and visualization, which will lead to errors. If you don’t want to show the code highlighting effect, just write the code according to your usual habits.

List of languages supported by WP syntax plug-in:

Copy code

The code is as follows:

‘actionscript’ =&gt; array(‘as’),
‘ada’ =&gt; array(‘a’, ‘ada’, ‘adb’, ‘ads’),
‘apache’ =&gt; array(‘conf’),
‘asm’ =&gt; array(‘ash’, ‘asm’, ‘inc’),
‘asp’ =&gt; array(‘asp’),
‘bash’ =&gt; array(‘sh’),
‘bf’ =&gt; array(‘bf’),
‘c’ =&gt; array(‘c’, ‘h’),
‘c_mac’ =&gt; array(‘c’, ‘h’),
‘caddcl’ =&gt; array(),
‘cadlisp’ =&gt; array(),
‘cdfg’ =&gt; array(‘cdfg’),
‘cobol’ =&gt; array(‘cbl’),
‘cpp’ =&gt; array(‘cpp’, ‘hpp’, ‘C’, ‘H’, ‘CPP’, ‘HPP’),
‘csharp’ =&gt; array(‘cs’),
‘css’ =&gt; array(‘css’),
‘d’ =&gt; array(‘d’),
‘delphi’ =&gt; array(‘dpk’, ‘dpr’, ‘pp’, ‘pas’),
‘diff’ =&gt; array(‘diff’, ‘patch’),
‘dos’ =&gt; array(‘bat’, ‘cmd’),
‘gettext’ =&gt; array(‘po’, ‘pot’),
‘gml’ =&gt; array(‘gml’),
‘gnuplot’ =&gt; array(‘plt’),
‘groovy’ =&gt; array(‘groovy’),
‘haskell’ =&gt; array(‘hs’),
‘html4strict’ =&gt; array(‘html’, ‘htm’),
‘ini’ =&gt; array(‘ini’, ‘desktop’),
‘java’ =&gt; array(‘java’),
‘javascript’ =&gt; array(‘js’),
‘klonec’ =&gt; array(‘kl1’),
‘klonecpp’ =&gt; array(‘klx’),
‘latex’ =&gt; array(‘tex’),
‘lisp’ =&gt; array(‘lisp’),
‘lua’ =&gt; array(‘lua’),
‘matlab’ =&gt; array(‘m’),
‘mpasm’ =&gt; array(),
‘mysql’ =&gt; array(‘sql’),
‘nsis’ =&gt; array(),
‘objc’ =&gt; array(),
‘oobas’ =&gt; array(),
‘oracle8’ =&gt; array(),
‘oracle10’ =&gt; array(),
‘pascal’ =&gt; array(‘pas’),
‘perl’ =&gt; array(‘pl’, ‘pm’),
‘php’ =&gt; array(‘php’, ‘php5’, ‘phtml’, ‘phps’),
‘povray’ =&gt; array(‘pov’),
‘providex’ =&gt; array(‘pvc’, ‘pvx’),
‘prolog’ =&gt; array(‘pl’),
‘python’ =&gt; array(‘py’),
‘qbasic’ =&gt; array(‘bi’),
‘reg’ =&gt; array(‘reg’),
‘ruby’ =&gt; array(‘rb’),
‘sas’ =&gt; array(‘sas’),
‘scala’ =&gt; array(‘scala’),
‘scheme’ =&gt; array(‘scm’),
‘scilab’ =&gt; array(‘sci’),
‘smalltalk’ =&gt; array(‘st’),
‘smarty’ =&gt; array(),
‘tcl’ =&gt; array(‘tcl’),
‘vb’ =&gt; array(‘bas’),
‘vbnet’ =&gt; array(),
‘visualfoxpro’ =&gt; array(),
‘whitespace’ =&gt; array(‘ws’),
‘xml’ =&gt; array(‘xml’, ‘svg’),
‘z80’ =&gt; array(‘z80’, ‘asm’, ‘inc’)

Download the WP syntax plug-in (modified quicktags. JS)

Recommended Today

Query SAP multiple database table sizes

Query SAP multiple database table sizes Item code db02 Here are two approaches, In the first graphical interface, the results of the query data table are displayed in MB, and only one table can be queried at a time. SPACE—Segments—Detailed Analysis—Detailed Analysis  In the pop-up window segment / object, enter the name of the […]