WordPress post titles are usually in the h1 tag by default. How to write the post title inside the h2 tag?
WordPress Post Title
I go through all the themes files but can not get any solution. When I Inspect the page, I find this A Comprehensive Guide to Holistic Health and Wholeness. Which means the page title is inside the named "entry-title". But I can not find such a class in the theme files. I need to modify the title tag and make it into h2 tag. Squaretype theme is used here.
2
Answers
You can render the H2 tag for title by passing parameters in the_title() function, like this:-
This is written in the user contribution in the_title() function page of WordPress documentation. I read it there.
Another way is to use get_the_title() function, it will just give the title text. And then you can wrap it in the h2 element. Here is the example:-
Here you can find the post title in single.php file or content-single.php file just replace