在 tumblr 中,只显示主页中带有特定标签的帖子 [英] In tumblr, show only posts with a certain tag in the home page

查看:19
本文介绍了在 tumblr 中,只显示主页中带有特定标签的帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 tumblr 中,是否可以在主页中只显示带有特定标签的帖子?
如果是这样,它是如何完成的?

In tumblr, is it possible to show only posts with a certain tag in the home page?
If so, how is it done?

推荐答案

我知道这个话题已经很老了,但我想我会与那些仍在寻找这个问题的答案的人分享我所做的.

I know that this topic is quite old, but I figured I'd share what I did for anyone who is still looking for an answer to this problem.

首先,在</title>"后面粘贴以下代码在您的主题 HTML 中.

First, paste the following code after the "</title>" in your theme HTML.

<meta name="text:Default Tag" content="" />

接下来,紧接在"之后在您主题的 HTML 中,粘贴以下内容:

Next, right after the "<body>" in your theme's HTML, paste the following:

{block:IndexPage}<script type="text/javascript">
    var url = location.href;
    if (url == "{BlogURL}") {
        window.location = "{BlogURL}tagged/{text:Default Tag}";
    }
</script>{/block:IndexPage}

在您的主题设置中,您应该会看到一个标有默认标签"的框.将您希望帖子显示的标签放在该框中(不带主题标签),然后点击保存.

In your theme settings, you should see a box labeled "Default Tag". Put the tag you'd like posts to appear for in that box (without a hashtag) and click save.

现在,如果有人访问您的博客,它会将他们转发到显示带有您指定标签的帖子的页面.当然,这可能不是最好的方法,但这是我能想到的最好的方法,不会弄乱主题.

Now, if someone visits your blog, it will forward them to the page that shows posts with your specified tag. Of course, this probably isn't the best way of doing it, but it's the best way I could come up with that wouldn't mess up themes.

我喜欢这种方式的另一件事是,您可以将您的博客 URL 与/?"一起发送给某人.附加到它(例如myblog.tumblr.com/?"),它会显示您的所有帖子.

Another thing I like about this way of doing this, is that you can send someone your blog URL with a "/?" appended to it (e.g. "myblog.tumblr.com/?") and it will show all of your posts.

这篇关于在 tumblr 中,只显示主页中带有特定标签的帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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