我正在使用简单的代码来创建搜索页面
$argscontactdirectory = array(
"s" => get_search_query(),
\'post_type\' => array( \'expertarticle\'),
\'orderby\' => \'title\',
\'order\' => \'ASC\',
);
然而,当搜索查询包含“&;”时,上面是我正在使用的代码如果搜索查询为M&M
URL栏将显示?s=M&M
我尝试了很多东西,包括urlencode()
, 但它也不起作用。
这里可以看到一个实例:http://sandbox.indiadairy.com/?s=hello&p_type=is
非常感谢您的帮助。