添加搜索表單一個div裏面我想添加一個div內搜索表單使用的代碼波紋管:在WordPress的
printf('<div class="entry"><p>%s</p>%s</div>', apply_filters('genesis_noposts_text', __('Try again below.', 'genesis')), get_search_form());
但每次我添加它的股利之前產生的get_search_form()
,像以下內容:
<form></form>
<div class="entry"></div>
我找到的解決辦法是分割的代碼,但我想知道是否有更好的解決方案,工作正常。
remove_action('genesis_loop_else', 'genesis_do_noposts');
add_action('genesis_loop_else', 'mytheme_do_noposts');
function mytheme_do_noposts() {
printf('<div class="entry"><p>%s</p>', apply_filters('genesis_noposts_text', __('Try again below.', 'genesis')));
printf('%s</div>', get_search_form());
}