While working on the previous post, I was trying to find a way to add HTML to the post itself without messing up the code. I looked for plugins and posts to give me some help. I finally realized that I needed to wrap the code in a <pre><code> wrapper. Once I realized that I wanted to make it easy to click a button and add the tags and text and then add the HTML code in the Visual Editor. Here’s what I did:
- Open up your functions.php file in the Themes folder
- Add this code to the bottom
- You can substitute the <pre><code> tags for your own using the rules in the commented notes. I added both the open tag and the closing tag when I click the button. That way I just need to click it once and then return to the Visual Editor to add the HTML code.