wordpress 更换域名

wordpress 更换域名

UPDATE wp_options SET option_value = replace(option_value, 'www.mydomain.com','www.newdomain.com') ;
UPDATE wp_posts SET post_content = replace(post_content, 'www.mydomain.com','www.newdomain.com') ;
UPDATE wp_comments SET comment_content = replace(comment_content, 'www.mydomain.com', 'www.newdomain.com') ;
UPDATE wp_comments SET comment_author_url = replace(comment_author_url, 'www.mydomain.com', 'www.newdomain.com') ;

wordpress Gravatar 都被墙了修复

编辑当前主题的functions.php文件,在底部加入

//头像使用duoshuo缓存
function get_avatar_deadwood( $avatar ) {
  $avatar = preg_replace( "/http:\/\/(www|\d).gravatar.com/","http://gravatar.duoshuo.com",$avatar );
  return $avatar;
}
add_filter( 'get_avatar', 'get_avatar_deadwood' );

打开wp-includes/pluggable.php文件,你可以找到这样一段代码

if ( 'mystery' == $default )

删除这个if判断,或者使他判断条件失效

if ( 'mystery' == '2B' )

搞定