add_filter() and apply_filters() – WordPress Filter Hooks – Part 2

WordPress Filter hooks add ease of customization to your code and help you modify content in the way you want. Read about WordPress Filter Hooks (Part-1). Here’s some more about Filter hooks and the stuff you can do with ’em: Let’s take example of function greet_employee().

We want to greet employees personally.…

How to calculate difference between two dates?

Someday, sometimes, you might need to Calculate difference between two dates. No need to bite your teeth and wander on the web! Here are some ways you can easily get the difference between any two dates. Let’s take two random dates.. Start Date: 2010-03-24  and  End Date: 2015-06-26 Use simple DateTime and DateInterval objects;

TypeError: $ is not a function

Does TypeError: $ is not a function when calling a jQuery function in WordPress give you cramps? This error usually arises when some jQuery script contains

In WordPress, $ is not used as a shortcut for jQuery. WordPress runs their own scripting before any other script is run. Releasing $ variable prevents collision with other libraries…

Add custom post types in search results, rss feed and right now dashboard widget

WordPress is a bit biased with custom post types, doesn’t include them in search results, doesn’t show them in rss feeds and doesn’t keep up with them in its right now dashboard widget. Here is how to fix : Include custom post types in the search results.

Add your custom post types to your…

WordPress : Short and Efficient way to check your site performance

This short little function will show How many queries are running on current page and in how much time, using how much of server memory. Add this in theme’s functions.php

WordPress : Improve quality of resized images

Add the below code snippet in your theme’s functions.php to improve quality of your resized images.

Add Thumbnails in Manage Posts/Pages List

WordPress by default, doesn’t show pages/posts featured image on the list. adding below snippet will add a Thumbnail column to your pages/post list screen.