0

When i create a frontpage or another page or post, the titles i choose in the editor become h2-tags when the page or post is launched.

I would very much like this to be a h1-tag instead. Can i change this setting anywhere?

Theme name is 'Rocked' and my website is http://filmhygge.dk.

0

You need to alter the template files under the theme folder. In the folder template-parts there is content-page.php that renders the page (well, at least the part with the header) and content-single.php that has the single post's title part.

Just change the <h2> and </h2> tags to be <h1> and </h1> respectively on the <?php the_title( '<h2 class="entry-title">', '</h2>' ); ?> part.

6
  • Thanks a lot. Although i tried this and it didn't change anything. The title on my front page is still a h2 tag. Is it just a matter of waiting for some time for it to update properly? – Mads Grønlund Jun 22 '17 at 10:36
  • I think the home page part might come from the content.php file. Did you change that also? Well, all the files (except content-none) under the template-parts folder have the <h2> tag in them it seems :) – jimihenrik Jun 22 '17 at 10:39
  • Yeah I changed all of them from h2 to h1 now. Still no difference though. I am not using FTP-software tho (as i have no idea how to use it), so I'm just making the changes in the backend of my webhosting provider. Maybe it's just slow? – Mads Grønlund Jun 22 '17 at 10:43
  • Sure it's possible there's some kind of caching going on, so to be sure, wait for a while. With a quick searh there's also some <h2 tags in functions.php, under "site branding" and "header text", don't know if those might have some effect on it as well. – jimihenrik Jun 22 '17 at 10:46
  • It appears to be updated now! Thanks a lot :-). Next problem is that the fontsize of the title is now so much smaller than the other headings, haha.. Gotta try and fix that though :) – Mads Grønlund Jun 22 '17 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.