How to require only Cyrillic input

A case from the practice: You have an e-commerce website integrated with the local delivery company. The thing is that all the address’ fields should be filled in Cyrillic as this is the expected input. Any Latin input will break the delivery service. So you need to make sure that only Cyrillic characters are used. …

Get the visitor’s country by their IP

Basically the code is something like this:  

So we are using the GeoPlugin API to retrieve the Country code. You can also get the full country name, state, city, continent and some other stuff. Here is a simple dump of the data returned from the site:

For more info and explanations and …

Displaying the shortcode from Custom post type content or Metabox

Whenever you try to display a shortcode through custom field you will get the text part and the shortcode function won’t be trigger.  To avoid this you can apply the following filter in your code:  

“the_custom_field” should be replaced by your own custom field name. Basically you can apply this filter to any …

Add new options to any wordpress theme in the Customize panel

Let’s say that you need a second logo image to be added in your header. And let’s assume that this should be editable feature. The easiest way to manage this task is to make a new option in the Customize panel (Appearance -> Customize) to upload a logo image and add a link to it. …