0
在WordPress中,我使用以下代碼進行搜索。爲什麼搜索沒有顯示
在頭版它工作正常,但在頁面的其餘部分,當我點擊搜索按鈕,它跳到頭版,我也注意到了URL變化
http://www.example.com/post-title/?s=meme
下面是搜索形成。
<form role="search" method="get" action="<?php echo esc_url(home_url('/')); ?>">
<input type="search" value="<?php echo get_search_query() ?>" name="s" title="Search"/>
<button type="submit" class="btn btn-default">Search</button>
</form>
謝謝您的回覆搜索
http://www.example.com/?s=meme
以下格式。仍然不起作用。 –在瀏覽器中輸入「http://www.example.com/?s = meme」wordpress不會在您的網站上搜索詞meme嗎? –
是的,這工作正常,http://www.example.com/?s=meme但是,當我點擊搜索按鈕,URL會自動更改爲http://www.example.com/post-title/? S =模因 –