Snippets Archive

Codes that are meant to be useful for others. Commercial use of my code strictly prohibited.

Data Serialization in PHP

If you are fairly new to PHP language, you may or may not be familiar with the idea of data serialization ...

Setup Default Timezone in PHP

If you are developing a PHP based website, or working on your custom PHP driven CMS that will interact with MySQL or any other database chances are there that you may need to define default timezone for your site or application ...

Get the Template File name in WordPress

WordPress theme by default uses number of template files to display content. These pages or files are generally known as theme files (page ...

Custom Page Template in WordPress

In general most of the pages created from WordPress "Pages" section gets displayed using the "page.php" template file (aka theme file) ...

Use Native WP Short URL

By default whenever you write a post or page, WordPress stores and assigns an ID number for every single entry made into the database ...

Stop Image Hotlinking using .htaccess

In general images from millions of web sites gets crawled by Google. Using great images on your site also increases your chances to get noticed by Google searchers ...

Add WooCommerce Support to a Custom Theme

If you are planning to build an eCommerce site on WordPress platform, WooCommerce is most probably the best solution available out there ...

Generate QR Code for your Post URL

Just in case if you like QR Code and want others to share your post's URL using simple QR code, there are good news for your ...

Assign Categories to Media Files

On WordPress you can upload numerous types of files to your "Media" section. Besides attaching those files with your posts, you can upload files and assign any registered taxonomy terms, just like the way you would assign categories to your posts ...