在Tumblr页面上按标签过滤帖子? [英] Filtering posts by tag on Tumblr page?

查看:163
本文介绍了在Tumblr页面上按标签过滤帖子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试确保只在我的tumblr主页上显示某个标签的帖子(即帖子标记为新闻)。它可以完成,怎么做?

I am trying to ensure only posts of a certain tag show up on my homepage of my tumblr, (i.e. posts tagged "News"). Can it be done, and how?

推荐答案

绝对有可能,但会涉及使用Tumblr的API。下面是使用JSON API和jQuery的示例......

Definitely possible but would involve using Tumblr's API. Below is an example using the JSON API and jQuery...

$.getJSON("http://{Name}.tumblr.com/api/read/json?tagged='[WHATEVER TAG YOU SPECIFY]'&callback=?", function(data) {     
    // Rest of code here...         
});

{Name}标签自动将tumblr的名称放入API URL。从这里你可能会使用jQuery将结果发布数据附加到页面上的某个位置,就像精选帖子div一样。

The {Name} tag automatically places the tumblr's name into the API URL. From here you would likely use jQuery to append to the resultant post data to somewhere on your page like a "Featured Posts" div.

http://www.tumblr.com/docs/en/api

http://api.jquery.com/jQuery.getJSON/

这篇关于在Tumblr页面上按标签过滤帖子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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