How can I add classes and an HTML tag inside a link tag of a Post in WordPress? Currently, when I link a word to one of my WordPress pages it looks like this:
<a href="http://localhost/website/contact/">contact</a>
I would like the linked word to appear as follows:
<a href="http://localhost/website/contact/" class="class1 class2"><span>contact</span></a>
This is because my theme uses span
for a hover feature.
If possible, I want this modification to apply only to the Post (Blog) section, using a class that all posts share: post-contents
.
While I know I can manually edit the HTML code of each post, I prefer a universal solution where every time I add a link in a post, the appropriate classes and span tags are automatically included. Any suggestions?