Snippets Archive

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

How to Block Bad Bots from Accessing a Site

Generally speaking, not all Bot or Internet Bots are bad. However there are overwhelming number of Crawling bot, Scrapping bots and so many other kinds of bots are out there that its almost impossible to stop all of them from accessing your site ...

Adding Custom Class to Post Thumbnail

Featured images are great way to display your posts with images, it does not only make your site look good but also can potentially attract visitors ...

Display Post Date in "Time Ago" Format

In order to display the post date we generally use the_time function on our template files. However, if you are interested to display the in "Time Ago" format that you may have seen on other websites, there is a simple WordPress function (human_time_diff) that we can use ...

Add Browser Specific Custom Body & Post Class

On my previous post, I explained how to display custom message based on user's web browser. Interestingly today I will discuss something pretty similar but with a little twist on it ...

Display Web Browser Specific Message

By default, WordPress comes with number of pre-built functions that can be really handy sometimes. It also gives you the flexibility of using number of Global Variables, particularly the browser detecting variables are simply awesome ...

Disable Visual Editing in WordPress

By default in WordPress, any registered users gets the privilege to edit or add content using the "Visual" mode or the "Rich Text Editing" screen ...

Rearranging the Post Admin Columns

The basic WordPress Post admin column is fairly well known to all. Luckily these columns can be arranged pretty much anyway you want ...

How to Schedule an Event in WordPress

WP comes with number of built-in functions that can be really useful. Particularly for developers who want's to perform certain operation on their site ...