我有一个针对产品自定义帖子类型的saperate搜索部分。与分页在同一页内的所需结果。单击saperate页面中显示的任何结果。但都在产品定制帖子、产品页面、产品模板、产品单一。下面是表单和一些代码。
<form role="search" method="get" id="searchform" action="<?php echo esc_url( home_url( \'/\' ) ); ?>">
<div class="row">
<div class="col-md-3">Search Keyword:</div>
<div class="col-md-3"><input type="text" placeholder="Search Product..."></div>
<div class="col-md-2"><input type="submit" id="searchsubmit" value="Searchi"> <input type="hidden" name="post_type" value="product"></div>
</div>
<div class="row">
<lable for="r1"><input type="radio" name="product-filter" id="r1" checked="chcecked"> Any Words</lable>
<lable for="r2"><input type="radio" name="product-filter" id="r2"> All Words</lable>
<lable for="r3"><input type="radio" name="product-filter" id="r3"> Exact Phrase</lable>
</div>
<em>Search term must be a minimum of 3 characters and a maximum of 20 characters</em>
</form>
以下是我的自定义帖子类型
add_action(\'init\', \'product_register\');
function product_register() {
$args = array(
\'label\' => __(\'Products\'),
\'singular_label\' => __(\'Product\'),
\'public\' => true,
\'show_ui\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'rewrite\' => true,
\'supports\' => array(\'title\', \'editor\', \'thumbnail\')
);
register_post_type(\'product\', $args);
}
add_action(\'admin_init\', \'admin_init\');
register_taxonomy(\'catalog\', array(\'product\'),
array(\'hierarchical\' => true,
\'label\' => \'Catalogs\',
\'singular_label\' => \'Catalog\',
\'rewrite\' => true)
);
function admin_init() {
add_meta_box(\'prodInfo - meta\', \'Product Options\', \'meta_options\', \'product\', \'side\', \'low\');
}
function meta_options() {
global $post;
$custom = get_post_custom($post -> ID);
$price = $custom[\'price\'][0];
echo \'<label> Price: </label><input type="text" name="price" value="\'. $price .\'"/ > \';
}
function save_price() {
global $post;
update_post_meta($post->ID, \'price\', $_POST[\'price\']);
}
add_action(\'save_post\', \'save_price\');
如何在div中显示结果?它还指示我到一个有特定结果的页面。请提供建议或指导?