2011-10-28 163 views
3

我是tumblr的新手,並試圖在自定義主題中實現搜索。我有: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主題中實現搜索還需要什麼?

謝謝!

+0

我遇到同樣的問題。我注意到,即使我從管理頁面(http://www.tumblr.com/blog/[blogname])搜索我的博客,我也沒有搜索結果。我想知道Tumblr的搜索功能目前是否被破解? – antinome

回答

0

這是我使用的解決方案。要把它放到你的代碼的<head>

<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搜索它的作品。

1

當我的博客受密碼保護時,我沒有收到任何結果。我從Tumblr儀表板>設置>博客名稱>密碼中刪除了密碼保護,並且它開始再次返回結果。