How to have different titles and meta tags for tag pages and index pages of Tumblr themes

落花浮王杯 提交于 2019-12-23 04:29:52

问题


In tumblr themes I found the following blocks for index page and tag pages respectively.

{block:IndexPage}{/block:IndexPage}  
{block:TagPage}{/block:TagPage}

But tag pages are taken as subset of index pages, so what i define in index page blocks also appear on tag pages along with whats in tag page blocks.

In such case how to define different title and meta tags independently for tag pages and index pages?


回答1:


Different titles on tag page:

<title>{block:TagPage}Posts tagged {Tag} - {/block:TagPage} {Title}</title>

You can't define different meta tags on tumblr.

You can however define multiple meta tags for background color for instance, and use on as standard and on on the tag page.

<meta name="color:Background" content="#eee"/>
<meta name="color:Background Tag Page" content="#666"/>

In the css:

body {
  background: {color:background};
  {block:TagPage}
  background: {color:background tag page};
  {/block:TagPage}
}

The usefulness of this method is debatable though. I think it would work okay for a personal blog at least.



来源:https://stackoverflow.com/questions/25331367/how-to-have-different-titles-and-meta-tags-for-tag-pages-and-index-pages-of-tumb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!