1、批量修改文章标题: UPDATE wp_posts SET post_title= replace( post_title, '老的', '新的' ); 1、批量修改文章内容: UPDATE wp_posts SET post_content = replace( post_content, '老的', '新的' ); 2、批量修改文章摘要: UPDATE wp_p
//搜索过滤,仅搜索post文章 function SearchFilter($query){ //仅搜索时 if($query->is_search){ //设定指定的文章类型,这里仅搜索文章 $query->set('post_type',array('post')); //指定文章和自定义类型 //$query->set('post_type', array('p
下面以把 wp_postmeta 表中的 “_laoziduan” 字段名修改成 “_xinziduan” 为例, 我们只需要登录MySQL,然后执行以下命令即可; update wp_postmeta set meta_key= replace(meta_key,'_laoziduan','_xinziduan');
function filter_pre_get_posts( $query ){ if ( $query->is_main_query() ){ $num = ''; if ( is_category(array(2)) ){ $num = 20; }//例如分类ID为2的显示20篇 if ( '' != $num ){ $query->set( 'posts_per_
把下面这段代码添加到当前主题的 functions.php 文件内即可: //隐藏默认分类图像描述 function wmou_hide_category_description() { ?> <style type="text/css"> .term-description-wrap,#description,.descripti