2011年11月24日 WordPress
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
<input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<?php wp_dropdown_categories('show_option_all='.__('ALL').'&hide_empty=0');?>
<input type="submit" id="submit" value="検索" />
</form>
Formタグ内の適当な箇所に以下を追加します。
<?php wp_dropdown_categories('show_option_all='.__('ALL').'&hide_empty=0');?>

この投稿へのコメント

コメントはまだありません。

コメントを残す

メールアドレスが公開されることはありません。

次のHTML タグと属性が使えます。
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA


ピックアップ記事

wordpress 現在のuser_idやdisplay_nameを取得

2020年01月14日 WordPress
現在のuser_idを取得 [php] $user_id = get_current_user_id();[/php] 現在のdisplay_nameを取得 [php]$user = wp_get_current_user(); $display_name = $user->display_name;[/php]
「wordpress 現在のuser_idやdisplay_nameを取得」をはてなブックマークに追加

WordPressサイト全体に認証をかける

2011年11月30日 WordPress
プラグインダウンロード 以下のサイト内から「Angsuman’s Authenticated WordPress Plugin」をダウンロードします。 Angsuman’s Authenticated WordPress Plugin プラグイン編集 プラグインの内容が古くなっていて、最新のWordPressの認証に対応していないので、以下のように書き換えます。 ac_authenti…
「WordPressサイト全体に認証をかける」をはてなブックマークに追加

簡単に記事が編集出来る WordPress のプラグイン

2011年05月26日 WordPress
ということで、タイトル通りのプラグインを紹介します。 Front-end Editor はログインして管理画面から操作しなくても、WPのサイト上から記事やウィジェットなどの編集を可能にしてくれる便利なプラグインです。 Front-end Editorの使用方法 プラグインをダウンロード 管理画面からプラグインを追加するか、このへんからダウンロードして、FTPでサーバにアップしてください。 …
「簡単に記事が編集出来る WordPress のプラグイン」をはてなブックマークに追加

検索フォームを設置し、検索結果を表示させる

2012年01月23日 WordPress
1.まずは検索フォームを設置します searchform.php 2.次に検索結果を取得、表示させる search.phpの検索結果を表示させる部分…
「検索フォームを設置し、検索結果を表示させる」をはてなブックマークに追加

WordPressでトップページ以外の場合にbodyにクラス名を追加する方法

2022年11月12日 WordPress
[php] <?php //トップページ以外の場合にnot_homeクラスを追加 $body_class = ""; if ( !is_front_page() ) { $body_class .= ' not_home'; } ?> <body id="top" <?php body_class( $body_c…
「WordPressでトップページ以外の場合にbodyにクラス名を追加する方法」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy