添加标头h1,h2,h3(当代) [英] Add headers h1, h2, h3 (Contempo)

查看:120
本文介绍了添加标头h1,h2,h3(当代)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助我需要在一周前刚刚发布的Blogspot主题"Contempo"中正确实现标头H1,H2和H3. 2017年3月20日.(提马当代音乐)

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)

默认情况下,帖子标题为H3

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>

我需要更好的SEO来实现

And I need for better SEO to implement

文章的H1标题 H2文章的内部字幕 文章的H3字幕

H1 title of article H2 internal subtitle of the article H3 subtitle of article

我已经实现了这段代码

<b:if cond='data:blog.pageType == &quot;index&quot;'>
   <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>

但是我得到: H1博客名称 H1文章名称

But I get: H1 blog name H1 article name

而且我认为家里不应有2个H1,因此实施效果不佳

And I think there should not be 2 H1 in the home, so something is poorly implemented

"Contempo"主题带来了另一件引人注目的条目,在家庭中显示为H3

Another thing the Contempo theme brings a prominent entry and this is shown in the home as H3

推荐答案

您是对的,该页面不应包含两个h1元素.

You're right that the page should not contain two h1 elements.

转到模板中的Header1小部件并替换为:

Go to Header1 widget in your template and replace this:

<b:include name='super.title'/>

使用:

<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>

这篇关于添加标头h1,h2,h3(当代)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆