DEV Community

kumamon
kumamon

Posted on • Edited on

【WordPress】検索窓のデザイン(searchform.php)のデザインテンプレ(改訂版)

php

<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
<label>
<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'サイト内検索', 'placeholder' ) ?>" value="<?php echo get_search_query() ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
</label>
</form>

style

.search-field{
background:#e8f3ff;
text-align:center;
border:none;
box-shadow:2px 2px 2px #e0e0e0;
height:40px;
padding:0 0 0 10px;

}

.search-form{
margin:10px 0;
}

/*****サイドバー使うなら***/
.formside{
width:165px;
margin-top: 20px;
}

Top comments (0)