Change the post title tag to h2


Note :This snippet works only with the Classical style option. The Classical style option can be enabled in Appearance > Customize > Advanced > Theme Style. More about the theme style option here


In the Customizr WordPress theme, you can easily change the default h1 html tag of the post or page title with the ‘tc_content_title_tag’ filter.

The quick example below illustrates how to change every post of page title to h2 (instead of the default h1)

You can be more specific and use the WordPress conditional tags

 

Where to paste this code? => in your functions.php file. I strongly recommend to create a child theme. Download a start-up child theme here.

Everything you need to know about child theme with Customizr here.


Related Snippets you may also like


We can help you to implement this snippet

Coding is our job and we know WordPress inside and out. We can help you to customize your website with small chunks of code snippets like this one.

Send us your request and we'll get back to you quickly.



8 thoughts on “Change the post title tag to h2

  • Matt Bingham

    Any idea how to change the post titles on Archive/category pages from h1 to h2; and not on the post page itself?

  • Lee

    I’m trying to just take out the .format-icon. How do I do that? I tried overwriting the css to have the font-family to something else but that didn’t work. I just want to take out .format-icon in the html. How do I do that?

    • Nicolas Post author

      Hi Lee, you can use filters to remove them : tc_content_title_icon and tc_archive_icon.

      Paste this code in your functions.php file and you are done

Comments are closed.