We use the WordPress editor on a daily basis so having quick access to certain html tags speeds up our productivity. We’re also primarily a team of developers so we use the html editor instead of the visual one.
Most of the default html editor buttons (also known as Quicktags) are fine, but there’s a few additional ones we wanted to include. After reading through dozens of tutorials online and not finding the “correct” way to do this, we decided to figure it out for ourselves.
Ok, let’s get to the code. You’ll want to paste the following function in your theme’s functions.php file.
Note: We purposely added a space in </ pre> so the example code above would render correctly. You’ll need to remove it in order for the tag to work in your code.
Adding buttons to the visual editor is a different process and a bit more advanced. You’ll need a custom icon in addition to some more code. We haven’t come across any “correct” tutorials yet but may produce our own in the future.
Like this tutorial? Subscribe and get the latest tutorials delivered straight to your inbox or feed reader.