10/7/14

Remove the 'WordPress.org' link from my 'Meta' list

Edited /wp-includes/default-widgets.php file at line 296:

$widget_ops = array('classname' => 'widget_meta', 'description' => __( "Login, RSS, &") );



Original code

  • RSS
  • '); ?>
  • RSS
  • '); ?>
  • WordPress.org
  • Edited version commented-out unwanted code
    
    
  • 10/6/14

    Direction

    My direction has changed from the right way. Nowadays mobile is the future. So do all my time on mibile, athough it's tired.

    10/5/14

    wordpress 禁用google字体

    最近国内网络控制,用wordpress制作网站应用到google字体的模板就会一直加载fonts.googleapis.com。网站会很慢,解决的办法就是将字体禁止或者本地。
    字体本地化
    新建google-font.css 放在\wp-includes\css目录中(附该css文件的内容如下)
    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 300;
      src: local('Open Sans Light'), local('OpenSans-Light'), url(../fonts/google/DXI1ORHCpsQm3Vp6mXoaTRa1RVmPjeKy21_GQJaLlJI.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 400;
      src: local('Open Sans'), local('OpenSans'), url(../fonts/google/u-WUoqrET9fUeobQW7jkRT8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 600;
      src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(../fonts/google/MTP_ySUJH_bn48VBG8sNSha1RVmPjeKy21_GQJaLlJI.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: italic;
      font-weight: 300;
      src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url(../fonts/google/PRmiXeptR36kaC0GEAetxrsuoFAk0leveMLeqYtnfAY.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: italic;
      font-weight: 400;
      src: local('Open Sans Italic'), local('OpenSans-Italic'), url(../fonts/google/xjAJXh38I15wypJXxuGMBtIh4imgI8P11RFo6YPCPC0.woff) format('woff');
    }
    @font-face {
      font-family: 'Open Sans';
      font-style: italic;
      font-weight: 600;
      src: local('Open Sans Semibold Italic'), local('OpenSans-SemiboldItalic'), url(../fonts/google/PRmiXeptR36kaC0GEAetxmWeb5PoA5ztb49yLyUzH1A.woff) format('woff');
    }
    修改 \wp-includes\script-loader.php 文件,找到
    $open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";
    替换成
    $open_sans_font_url = "/wp-includes/css/google-font.css";
    
    
    禁止google字体加载
    在wp的后台插件里面搜索安装Disable Google Fonts这款插件后启用即可,如果不想安装插件,也可以使用代码版,在主题的functions.php里面加入下面的代码:
     
    //禁用Open Sans
    class Disable_Google_Fonts {
    public function __construct() {
    add_filter( 'gettext_with_context', array( $this, 'disable_open_sans' ), 888, 4 );
    }
    public function disable_open_sans( $translations, $text, $context, $domain ) {
    if ( 'Open Sans font: on or off' == $context && 'on' == $text ) {
    $translations = 'off';
    }
    return $translations;
    }
    }
    $disable_google_fonts = new Disable_Google_Fonts;

    10/4/14

    Think

    There are many cheats and malices in the world. I can't believe in too many guys. Feel sad for it.
    Now I have little money, I'm worried about it every time I think about it. Anyway, continue to do what I should do.

    Use One Email Address with Multiple Twitter Accounts

    There’s however a simple workaround that will let you use the same email address with all your Twitter handles – the only condition is that you should be using a Gmail or Google Apps email address.
    In Gmail, you can add a dot (.) anywhere in the username and all emails address to that new alias will still reach your mailbox. For instance, if your original email address is hello@gmail.com, any emails sent to he.llo@gmail.com or he.ll.o@gmail.com will land in your mailbox because Gmails ignores periods in the email username.
    And that’s what you can use to trick Twitter. Twitter will consider hello@gmail and he.llo@gmail as two separate and valid email addresses even though they point to the same Gmail Inbox.
    Update: Please do that note that you have to enable the catch-all option in your domain setting to use email aliases inside Google Apps. Thus it is a better option to use a free Gmail address for Twitter.
    Another Workaround
    When you open an account in Gmail, you automatically get another valid email address that uses the googlemail.com domain.
    So if you only have two handles on twitter, you can use the gmail.com address with one handle and the googlemail.com address with the second handle.

    10/3/14

    百度账号体系和谷歌的天壤之别

    百度的账号体系一片混乱, 相对于谷歌一个账号全网全google产品通行, 简直就是小学生对大学生的区别.
    百度不注重这种用户体验, 可能也和公司的管理文化有关, 各个部门各自为政, 在业绩压力下互相不全力合作.

    python -m SimpleHTTPServer (Start a http server by python)

    python -m SimpleHTTPServer
    bogon:_video apple$ python -m SimpleHTTPServer
    Serving HTTP on 0.0.0.0 port 8000 ...
    192.168.0.102 - - [04/Oct/2014 01:56:21] "GET / HTTP/1.1" 200 -
    192.168.0.102 - - [04/Oct/2014 01:56:22] code 404, message File not found
    192.168.0.102 - - [04/Oct/2014 01:56:22] "GET /favicon.ico HTTP/1.1" 404 -

    192.168.0.102 - - [04/Oct/2014 01:56:24] "GET /%E4%BD%A0%E8%AF%95%E8%BF%87%E5%8D%81%E4%B8%80%E9%83%BD%E5%9C%A8%E5%96%9D%E5%96%9C%E9%85%92%E5%90%97.mov HTTP/1.1" 200 -

    10/2/14

    git 查看某个文件的修改历史

    1. git log -p filename
    查看文件的每一个详细的历史修改,如果没有-p选项,只显示提交记录,不显示文件内容修改,git log -p -3 filename 显示最近的3次提交。
    2. git log --pretty=oneline filename
    每一行显示一个提交,先显示哈希码,再显示提交说明。
    3. git blame filename
    查看文件的每一行是哪个提交最后修改的。

    progit上的更加详细

    如何查看wordpress版本号


    这里介绍三种方法。
    1进入后台“仪表盘”,该页面的左上角图片显示了wordpress的版本号。
    2 查看网页源代码
    在网站的主页空白处点右键弹出菜单,选择“查看网页源代码”。
    在出现的源码页面里查找
    Content值就是wordpress的版本号。
    3 查看readme文件
    进入wampsever的www目录下网站文件所在的文件夹
    (一般为“C:\wamp\www\example.com”),打开“readme”,该文件的正上方显著的位置写着wordpress的版本。

    WordPress更改域名无需修改数据库的方法

    大家一般都知道,WordPress网站更换域名,在成功导入数据库和转移网站数据库后,还需要修改HOME和SITEURL两个地址。一般人的做法大都是通过修改数据库,其实我们也不用那么麻烦和危险。下面,草根站长网就跟大家讲讲通过修改配置文件的三种方法来解决上述问题。
    方法一:修改wp-config.php1、在wp-config.php中,添加以下两行内容:
    define(‘WP_HOME’,’http://www.bitcall.org/’);
    define(‘WP_SITEURL’,’http://www.bitcall.org/’);

    www.bitcall.org代表你的新地址。