【问题标题】:Fix Tags Heading errors on Blogger修复 Blogger 上的标签标题错误
【发布时间】:2018-09-23 18:22:09
【问题描述】:

H1标签指的是文章的标题和博客的标题。而且每页应该只有一个H1标签。

这就是复杂的地方,因为博客的标题在帖子的页面中重复,因此会产生每页有 2 个 H1 标签的错误。

当我们在博客标题中放置一张图片并将此图片设置为显示而不是博客名称时,从 SEO 的角度来看,我们会自动删除标题。

如何解决?

这是我的模板中引用博客标题的代码

                      <b:widget id='Header1' locked='true' title='Xamãs Urbanos (Cabeçalho)' type='Header' version='2' visible='true'>
            <b:widget-settings>
              <b:widget-setting name='displayUrl'>https://1.bp.blogspot.com/-Zq-xjYJ4FPg/W6N3Pw888DI/AAAAAAAAHms/123YJTNssl0xQJ5ES82c5QuV6Gr6YwD5ACLcBGAs/s1600/Logo_Xamas_Urbanos_Ayahuasca_em_Porto_Alegre.png</b:widget-setting>
              <b:widget-setting name='displayHeight'>202</b:widget-setting>
              <b:widget-setting name='sectionWidth'>150</b:widget-setting>
              <b:widget-setting name='useImage'>true</b:widget-setting>
              <b:widget-setting name='shrinkToFit'>true</b:widget-setting>
              <b:widget-setting name='imagePlacement'>REPLACE</b:widget-setting>
              <b:widget-setting name='displayWidth'>150</b:widget-setting>
            </b:widget-settings>
            <b:includable id='main' var='this'>
          <div class='header-widget'>
            <b:include cond='data:imagePlacement in {&quot;REPLACE&quot;, &quot;BEFORE_DESCRIPTION&quot;}' name='image'/>
            <b:include cond='data:imagePlacement not in {&quot;REPLACE&quot;, &quot;BEFORE_DESCRIPTION&quot;}' name='title'/>
            <b:include cond='data:imagePlacement != &quot;REPLACE&quot;' name='description'/>
          </div>
        </b:includable>
            <b:includable id='behindImageStyle'>
          <b:if cond='data:sourceUrl'>
            <b:include cond='data:this.image' data='{                    image: data:this.image,                    selector: &quot;.header-widget&quot;                  }' name='responsiveImageStyle'/>
            <style type='text/css'>
              .header-widget {
                background-position: <data:blog.locale.languageAlignment/>;
                background-repeat: no-repeat;
              }
            </style>
          </b:if>
        </b:includable>
            <b:includable id='description'>
          <p>
            <data:this.description/>
          </p>
        </b:includable>
            <b:includable id='image'>
          <a class='header-brand' expr:href='data:blog.homepageUrl'>
            <img expr:alt='data:blog.title.escaped' expr:data-height='data:height' expr:data-width='data:width' expr:src='data:image'/>
          </a>
        </b:includable>
            <b:includable id='title'>
          <h1>
            <b:tag cond='data:view.url != data:blog.homepageUrl' expr:href='data:blog.homepageUrl' name='a'>
              <data:title/>
            </b:tag>
          </h1>
        </b:includable>
          </b:widget>

【问题讨论】:

    标签: xml tags blogger


    【解决方案1】:

    在图片标签后添加h1标题怎么样

    试试这个

     <b:widget id='Header1' locked='true' title='Xamãs Urbanos (Cabeçalho)' type='Header' version='2' visible='true'>
            <b:widget-settings>
              <b:widget-setting name='displayUrl'>https://1.bp.blogspot.com/-Zq-xjYJ4FPg/W6N3Pw888DI/AAAAAAAAHms/123YJTNssl0xQJ5ES82c5QuV6Gr6YwD5ACLcBGAs/s1600/Logo_Xamas_Urbanos_Ayahuasca_em_Porto_Alegre.png</b:widget-setting>
              <b:widget-setting name='displayHeight'>202</b:widget-setting>
              <b:widget-setting name='sectionWidth'>150</b:widget-setting>
              <b:widget-setting name='useImage'>true</b:widget-setting>
              <b:widget-setting name='shrinkToFit'>true</b:widget-setting>
              <b:widget-setting name='imagePlacement'>REPLACE</b:widget-setting>
              <b:widget-setting name='displayWidth'>150</b:widget-setting>
            </b:widget-settings>
            <b:includable id='main' var='this'>
          <div class='header-widget'>
            <b:include cond='data:imagePlacement in {&quot;REPLACE&quot;, &quot;BEFORE_DESCRIPTION&quot;}' name='image'/>
            <b:if cond='data:imagePlacement in {&quot;REPLACE&quot;, &quot;BEFORE_DESCRIPTION&quot;} and data:blog.pageType == &quot;index&quot;'><h1 style='display:none'><data:title/></h1></b:if>
            <b:include cond='data:imagePlacement not in {&quot;REPLACE&quot;, &quot;BEFORE_DESCRIPTION&quot;}' name='title'/>
            <b:include cond='data:imagePlacement != &quot;REPLACE&quot;' name='description'/>
          </div>
        </b:includable>
            <b:includable id='behindImageStyle'>
          <b:if cond='data:sourceUrl'>
            <b:include cond='data:this.image' data='{                    image: data:this.image,                    selector: &quot;.header-widget&quot;                  }' name='responsiveImageStyle'/>
            <style type='text/css'>
              .header-widget {
                background-position: <data:blog.locale.languageAlignment/>;
                background-repeat: no-repeat;
              }
            </style>
          </b:if>
        </b:includable>
            <b:includable id='description'>
          <p>
            <data:this.description/>
          </p>
        </b:includable>
            <b:includable id='image'>
          <a class='header-brand' expr:href='data:blog.homepageUrl'>
            <img expr:alt='data:blog.title.escaped' expr:data-height='data:height' expr:data-width='data:width' expr:src='data:image'/>
          </a>
        </b:includable>
            <b:includable id='title'>
          <h1>
            <b:tag cond='data:view.url != data:blog.homepageUrl' expr:href='data:blog.homepageUrl' name='a'>
              <data:title/>
            </b:tag>
          </h1>
        </b:includable>
    </b:widget>
    

    【讨论】:

    • 没用。在另一个网站上,他们说要添加以下代码:

      但是帖子太旧了,代码在我的博客上不起作用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-04-08
    • 1970-01-01
    • 2015-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多