How to automatically add custom classes to headings in content area

Question

Is there any way I can automatically add a custom class to heading tags (like h1, h2, h3, etc..,) in the content area. I know that I can manually add a class to a sub-heading from the post editor, but I want the class to be applied to all the headings in all the posts.

for instance, a normal heading will look something like this <h2>sub-heading</h2>. I want this to be changed to <h2 class="custom-class">sub-heading</h2>.

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/how-to-automatically-add-custom-classes-to-headings-in-content-area/">

How to automatically add custom classes to headings in content area</a>
0
, vamsi 1 week 0 Answers 16 views 0

Leave an answer