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 …

Prevent hotlinking on your media files

Whenever you want to ban/prevent hotlinking your media files and protect your server’s resources and bandwidth you may use the following snippet in the .htaccess file of your main directory of your site.

Just replace YOURSITE.YOURDOMAIN with your site and at the fourth row of the actual code (don’t mind the # comment line) …

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. …

Registring widget area and how to use it later

To register a widget area for you theme you should  use the register_sidebar function in your theme’s function.php.

This function will register the widget’s area through the ‘widgets_init’ hook. For more specification on register_sidebar please see here. Next step is to set the place where we want to see the widgets to be displayed. …