wordPress学习积累

Wordpress防采集

 

if(!$_SERVER['HTTP_USER_AGENT']) { //判断是否为空AGENT
header("Content-type: text/html; charset=utf-8");
echo '不许采集!因为采集的站长MJJ!';
exit;
}

 

 

 

 

Wordpress启用gzip

//在打开的index.php 中找到:

define('WP_USE_THEMES', true);

//在后面加上:

ob_start('ob_gzhandler')

参考链接

 插件整理

 

WordPress: Could not create directory – Plugin Install Failed解决方案

//Add the marked lines in your wp-admin/includes/class-wp-filesystem-direct.php (Line 281):

function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
   // safe mode fails with a trailing slash under certain PHP versions.
   $path = untrailingslashit($path);
   if ( empty($path) )
      $path = '/';

   if ( ! $chmod )
      $chmod = FS_CHMOD_DIR;

//or SSH into your server and run:

sudo chown -R apache:apache /var/www/html/msong/

 

 

直接安装插件,不进行FTP登陆验证

define( 'FS_METHOD', 'direct' );

 

 

去掉”自豪的采用wordpress”字样

\wp-content\themes\twentyeleven\footer.php

注意:汉字采用 UTF-8代码编辑

 

修改右侧“WordPress.org”

includes/default-widgets.php 

搜索WP_Widget_Meta 行

 

Linux 下 *.po / *.mo 文件互转

要使用到GNU Gettext下的两个软件:msgunfmt和msgfmt

yum -y install gettext

然后在linux下进行转换

msgfmt *.po -o *.mo
或
msgfmt *.mo -o *.po

 

提升网站速度

WP Super cache 静态化缓存插件使用方法

 

 

 

posted @ 2013-04-09 17:01  Younger  阅读(615)  评论(0)    收藏  举报