wordpress模板编写,定义搜索框get_search_form样式

模板下functions.php文件加入以下代码

function my_search_form( $form ) {
 
    $form = '<form class="form-inline my-2 my-lg-0" role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
 
    <input type="text" class="form-control mr-sm-2"  value="' . get_search_query() . '" name="s" id="s" />
    <input type="submit" id="searchsubmit" class="btn btn-outline-info my-2 my-sm-0" value="'. esc_attr__('Search') .'" />
 
    </form>';
 
    return $form;
}
 
 
add_filter( 'get_search_form', 'my_search_form' );


This entry was posted in JAVA and tagged . Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/wordpress-template/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

  

About Me

静水流深,水滴石穿