Wordpress Localization

wp i18n make-pot . languages/domain.pot (这个domain很重要,不是plugin的名字) copy my-plugin.pot to domain-zh_CN.po msgfmt -o domain-zh_CN.mo domain-zh_CN.po copy po和mo文件到 wp-content/languages/plugins/ 目录 change wp-config.php: define (‘WPLANG’, ‘zh_CN’); Go to wp-admin/options-general.php or “Settings” -> “General” Select your language in “Site Language” dropdown Go to wp-admin/update-core.php Click “Update translations”, when available Core translations files are downloaded, Read more…

What Are WordPress Transients?

In order to understand transients, it’s helpful to have some basic knowledge of caching and Application Programming Interfaces (APIs).  Caching webpage data is essentially a way of temporarily saving a website’s data so that if there are multiple requests for the same data, the site doesn’t have to re-run MySQL or PHP. This Read more…

wordpress tips tricks

Wordpress: How to add pagination to a single post

The line will fail, because on singular post view, when the URL contains ‘/page/XX/’, the variable WordPress sets is ‘page’ and not ‘paged’. You may think to use ‘page’ instead of ‘paged’, but that will not work either, because once the ‘page’ variable is intended to be used for multi-page singular post (page separation using <!–nextpage–>) and once the post Read more…