Tumblr:搜索未返回搜索结果

发布于 2024-12-13 01:33:40 字数 436 浏览 3 评论 0原文

我是 tumblr 新手,正在尝试在自定义主题中实现搜索。我有:

<form action="/search" method="get" id="search-form">
    <input type="text" name="q" class="query" value="" />
    <input type="submit" value="Search" class="submit" />
    <div class="clear"></div>
</form>

我有大约十几个帖子。每当我在任何帖子中搜索任何内容时,Tumblr 总是不返回任何搜索结果。我觉得我失去了一些东西。我是否要在主题中的其他位置实施或设置任何配置?在用户的 Tumblr 主题中实现搜索还需要什么?

谢谢!

I'm new to tumblr and am trying to implement Search in a custom theme. I have:

<form action="/search" method="get" id="search-form">
    <input type="text" name="q" class="query" value="" />
    <input type="submit" value="Search" class="submit" />
    <div class="clear"></div>
</form>

I have about a dozen posts. Whenever I search for anything in any post, Tumblr always returns no search results. I feel like I'm missing something. Am I to implement or set any configuration anywhere else in the theme? What else is needed to implement search in a user's Tumblr theme?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

◇流星雨 2024-12-20 01:33:40

这是我使用的解决方案。将其放入代码的 中:

<script type="text/javascript">
<!--
function handleThis(formElm)
{
window.location="/tagged/"+formElm.number.value+"";
return false;
}
-->
</script>

并将其放置在您希望搜索框出现的位置:

<form onsubmit="return handleThis(this)">
<div class="submit"><input type="submit" value="{lang:Search}" name="Submit"/></div>
<div class="input"><input onfocus="this.value=''" onblur="if(this.value=='') this.value='Search. Then hit enter.';" type="text" value="{lang:Search}. Then hit enter." name="number"/></div>
</form>

使用 CSS 根据您的意愿设置样式。这只会搜索您的标签,但与常规的 Tumblr 搜索不同,它有效。

Here's the solution I use. Put this into the <head> of your code:

<script type="text/javascript">
<!--
function handleThis(formElm)
{
window.location="/tagged/"+formElm.number.value+"";
return false;
}
-->
</script>

And place this where you want the search box to appear:

<form onsubmit="return handleThis(this)">
<div class="submit"><input type="submit" value="{lang:Search}" name="Submit"/></div>
<div class="input"><input onfocus="this.value=''" onblur="if(this.value=='') this.value='Search. Then hit enter.';" type="text" value="{lang:Search}. Then hit enter." name="number"/></div>
</form>

Use CSS to style as you wish. This will search your tags only, but unlike the regular Tumblr search it works.

等风也等你 2024-12-20 01:33:40

当我的博客受到密码保护时,我没有得到任何结果。我从 Tumblr Dashboard > 中删除了密码保护设置>博客名称>密码,它再次开始返回结果。

I was getting no results when my blog was password protected. I removed the password protection from Tumblr Dashboard > settings > blog name > password and it started returning results again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文