jacall.net
前端开发工作者
© JaCall.Net
All Rights Reserved.

把页面从搜索结果中排除

add_filter('pre_get_posts','search_filter');
function search_filter($query) {
    if ($query->is_search) {
        $query->set('post_type', 'post');
    }
    return $query;
}

 

2013-11-01
1,386 views
暂无评论

发表评论