Cách hiển thị đoạn code trong WordPress

Sử dụng PrettyPrint

Github URL: https://github.com/googlearchive/code-prettify

<pre class="prettyprint">&lt;code class="language-c">
// your code here
&lt;/code>&lt;/pre>

Hoặc
&lt;pre class="prettyprint">
// your code here
&lt;/pre>

Hoặc
&lt;pre class="prettyprint linenums:4"
>// This is line 4.
foo();
bar();
baz();
boo();
&lt;/pre>

Hoặc
&lt;style>
li.L0, li.L1, li.L2, li.L3,
li.L5, li.L6, li.L7, li.L8 {
  list-style-type: decimal !important;
}
&lt;/style>

Hoặc
&lt;pre class="result notranslate">
Book  title : C Programming
Book  author : Nuha Ali
Book  subject : C Programming Tutorial
Book  book_id : 6495407
&lt;/pre>

VD1:

<pre class="prettyprint">&lt;code class="language-c">
// your code here
&lt;/code>&lt;/pre>

// your code here

VD2:

<pre class="prettyprint">// your code here
&lt;/pre>
// your code here

VD3:

<code class="prettyprint">
// your code here
&lt;/code>

VD4:

<pre class="prettyprint linenums:4">// This is line 4.
foo();
bar();
baz();
boo();
&lt;/pre>
// This is line 4.
foo();
bar();
baz();
boo();

VD5:

<pre class="prettyprint linenums:4">// This is line 4.
foo();
bar();
baz();
boo();
&lt;/pre>

&lt;style>
li.L0, li.L1, li.L2, li.L3,
li.L5, li.L6, li.L7, li.L8 {
  list-style-type: decimal !important;
}
// This is line 4.
foo();
bar();
baz();
boo();

VD6:

<pre class="result notranslate">Book  title : C Programming
Book  author : Nuha Ali
Book  subject : C Programming Tutorial
Book  book_id : 6495407
</pre>
Book  title : C Programming
Book  author : Nuha Ali
Book  subject : C Programming Tutorial
Book  book_id : 6495407
Icons made by Freepik from www.flaticon.com