How to have different titles and meta tags for tag

2019-06-10 10:12发布

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条回答
手持菜刀,她持情操
2楼-- · 2019-06-10 11:08

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.

查看更多
登录 后发表回答