Posts

Showing posts from June, 2013

WPML How to translate value in OptionTree?

WPML is a plugin that is used to translate wordpress text to different language.

Warning: To understand how to translate values in OptionTree, you need to write PHP code, which means, you need to know how to program using PHP, how Wordpress Plugin works, and ideally, how to write a wordpress plugin.  Otherwise you will find very difficult to understand what the below content means.

I am using WPML 2.8.2.

And if you normally buy theme from ThemeForest.net, chance are you will see some themes that is using OptionTree to save theme value.

However, there are situation when, you enter some display text in admin panel, and you want to translate those text.

As of this writing, according to this reply, WPML is not compatible with OptionTree.  Although you can use some workarounds as described in that post, that workaround is actually OUTDATED and may not be applicable to you.

To understand the solution, you need to understand how OptionTree works first.

How OptionTree works?
If you click on the…

TCPDF How to show/display Chinese Character?

Thanks to this article (in Simplified Chinese, updated new link), there is a way to embed a TTF that can display Chinese (Traditional and Simplify, and possibly Japanese).
Environment: TCPDF 6.0.020PHP 5.3.8Windows 7 The problem: If you follow this post that said: using cid0cs or cid0ct to display Chinese, it can display the character correctly, only to the extend that user installed a correct font package.  However, chances are other users who didn't install that package cannot view that PDF since there are several packages and versions of PDF viewer (mainly Adobe).  And even worse: even if user installed certain CJK font package, the PDF still not displayed correctly (show empty page).

And according to the official TCPDF documentation about font:
The fonts that could be not embedded are only the standard core fonts and CID-0 fonts. The solution: Again, thanks to the post above (in simplified Chinese), now developer can use a font that:
Can display ChineseCan be embedded to PDF The…

SSL and javascript from other site

Here's to confirm that, if your website is protected under SSL, while at the same time, you include javascript file from another website, that JS file will NOT be included (blocked).

So if you found that your SSL-protected e-commerce website does not track statistic properly, chance are your javascript from another website is being blocked.  To verify, simply open javascript console to see the log.

To avoid this problem:

1. Disable SSL in main site
2. Add SSL in another site
3. Move your JS file to SSL main site.

If you are using PostAffiiatePro with WooCommerce, I recommended that you install PAP in e-commerce site.