CSS 如何在我的 tumblr 主题中显示标签?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18323880/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to show tags in my tumblr theme?
提问by Kermit Snap
I just installed thistheme and I've been trying to get it to show my tags.
我刚刚安装了这个主题,我一直试图让它显示我的标签。
I've tried adding the code to show tags, and while it will show them, it totally messes up the format of the theme. Not sure what I'm doing wrong, but any help would be much appreciated! Thanks (:
我已经尝试添加代码来显示标签,虽然它会显示它们,但它完全弄乱了主题的格式。不知道我做错了什么,但任何帮助将不胜感激!谢谢 (:
回答by End User
- Go to the Customizesection after you log in
- Click on the Themetab
- Click Use custom HTML
- 登录后转到自定义部分
- 单击主题选项卡
- 单击使用自定义 HTML
This will bring up a edit box that contains the HTML and tumblr code used by the theme.
这将打开一个编辑框,其中包含主题使用的 HTML 和 tumblr 代码。
Put the code for the tags somewhere between the opening {block:Posts}
and closing {/block:Posts}
tags.
将标签代码放在开始{block:Posts}
和结束{/block:Posts}
标签之间的某个位置。
To start off easy, let's put the tags at the bottom of all your post types.
为了轻松开始,让我们将标签放在所有帖子类型的底部。
Where you see the following line:
您会看到以下行:
{/block:Posts}
Insert the following starting chunk to look like this:
插入以下起始块,如下所示:
{block:HasTags}
{block:Tags}
<a href="{TagURL}">{Tag}</a>
{/block:Tags}
{/block:HasTags}
{/block:Posts}
- Click Update previewin the lower right corner of the edit box (or it will update itself)
- Click Save + Closein the upper right of the dashboard.
- 点击编辑框右下角的更新预览(否则会自行更新)
- 单击仪表板右上角的保存 + 关闭。
Refresh your tumblr blog and you should now see the tags display.
刷新您的 tumblr 博客,您现在应该会看到标签显示。
You can read more of the specific tags markup needed on the Tags section of "Creating a custom HTML theme"
您可以在“创建自定义 HTML 主题”的标签部分阅读更多所需的特定标签标记