I have installed prettyprint in my WordPress theme. Now in order to use it, I need to wrap my code in:
<pre class="prettyprint">
<code>
code here
</code>
</pre>
Now the code button on WordPress html editor provides only the <code></code>
tag. Now is there a way to edit this so that I can add the extra span
?
Add this in your functions.php:
Create a file called
quicktags.js
, place it into ajs
folder, in your theme directory.Copy all the content of your
/includes/js/quicktags.js
file. You can edit/delete/add anything, specially the last strings, which are the corresponding to editor tags.Now you can add your span:
That means: