H1 en H2 codes in Contempo
Help I need to implement header H1, H2 and H3 correctly in blogspot theme "Contempo", issue just released a week ago, approx. March 20, 2017. (Tema contempo)
By default comes H3 for the title of the post
<h3 class='post-title entry-title'>
<b:if cond='data:post.link or (data:post.url and data:view.url != data:post.url)'>
<a expr:href='data:post.link ?: data:post.url'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</h3>
And I need for better SEO to implement
H1 title of article H2 internal subtitle of the article H3 subtitle of article
I have implemented this code
<b:if cond='data:blog.pageType == "index"'>
<h2 class='post-title entry-title'>
<b:if cond='data:post.link or (data:post.url and data:view.url != data:post.url)'>
<a expr:href='data:post.link ?: data:post.url'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</h2>
<b:else/>
<h1 class='post-title entry-title'><data:post.title/></h1>
</b:if>
But I get: H1 blog name H1 article name
And I think there should not be 2 H1 in the home, so something is poorly implemented
Another thing the Contempo theme brings a prominent entry and this is shown in the home as H3
add a comment
0
You're right that the page should not contains two h1 elements.
Go to Header1 widget in your template and replace this:
<b:include name='super.title'/>
With:
<b:if cond='data:view.isSingleItem'>
<h2 class='title'>
<a expr:href='data:blog.homepageUrl'>
<data:title/>
</a>
</h2>
<b:else/>
<h1 class='title'>
<a expr:href='data:blog.homepageUrl'>
<data:title/>
</a>
</h1>
</b:if>
- Thanks for your help I worked as I wanted it, although the title of the blog changed the color of the links and put the title left. Your help is very great, I have asked everywhere and at last it could be done. Thanks Bassam – JhonnySanz Mar 31 '17 at 23:02
- Thanks Bassam, but unfortunately of css code I do not know anything. I'll mark it as fixed. Also I am putting in the forums that ask this url, so that others can solve the same problem of headings h1, h2 and h3 of blogger 2017. – JhonnySanz Mar 31 '17 at 23:19
- Ok I will update the code. – Bassam Mar 31 '17 at 23:20
- You can try the update. – Bassam Mar 31 '17 at 23:24
- The new code is what it does, because I see it the same – JhonnySanz Mar 31 '17 at 23:33
- Not the same, I put link after h1,h2 in the new code. – Bassam Mar 31 '17 at 23:39
- Thanks for your help – JhonnySanz Mar 31 '17 at 23:50