0
ワードプレスでは次のコードを検索に使用します。フロントページで検索が表示されなかった理由
それが正常に動作しますが、私は、検索ボタンをクリックすると、ページの残りの部分では、それがフロントページにジャンプし、私もここで
http://www.example.com/post-title/?s=meme
へのURLの変更が検索で気づきます形。
<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'」と入力すると、あなたのウェブサイトに「meme」という単語がありませんか? –
うん、うまくいく、http://www.example.com/?s=memeしかし、検索ボタンをクリックすると、URLは自動的にhttp://www.example.com/post-title/に変更されますか? s = meme –