WordPress – Add Retina Image Support to Your Theme

Today, with increasing of high resolution devices, Client ask developer to add retina image support to their theme. Support Retina is to display high quality image on high resolution devices. This means we need to create high resolution images and to load right images based on screen resolutions.

There are some plugins available on WordPress for regular users to add retina display images. Searching a wordpress directory for plugin shows below 5 plugins on top

Each plugin show use different way to show retina images but internal all  includes two things, A detection script and a retina-ready image creation function. For developer who want to include the feature of displaying retina image to their theme, It very first step to select right JavaScript to detect the screen resolution and display the image.

Detect Screen Display

We need to display high quality image if user device is supporting it. The best way to detect a screen is using JavaScript.  I generally use a script called retina.js by Imulus. Its size is only 4kb and includes all the front-end functionality you need to detect a retina display and load the right image.

Copy retina.js file to your theme /js folder. It should be in right place to enqueue the script correctly.

Add following code to your functions.php file

Above code is enough to detect the screen display. Now we have to create function to create high quality image.

High Quality Image Creation

We need to add a function such that each time image is uploaded or added a high resolution image is created automatically and stored with @2x added to the filename. The detection JavaScript will search for @2x suffix in filename to load the retina-ready version of the image if required.

In order to make sure that a retina-ready image is created automatically whenever an image is uploaded, you need to hook into the appropriate WordPress filter. The correct one to use is wp_generate_attachment_metadata.

Add the following code in functions.php of your theme

The above function checks to see if the uploaded file is an image. If it is, then it processes it using the retina_support_create_images() function.

Create An Image

Now as we checked if image is added and its time to create high quality image.

This code will also be placed in functions.php

By this function, new retina image will be created  with suffix @2x added to the name. Now detection script will work with these new image.

That’s all you need to do to make it work, but adding one extra function will help in reducing the usage of server bytes. This function is for deleting the image that we have created for retina display when original image is deleted.

Delete the Image

If is a good to delete the retina-image if original image is deleted.

Add following code to functions.php of your theme

In this tutorial we learn how to add support of displaying retina image in WordPress theme. This will help theme developer in adding retina support to their theme.


Thanks to wptuts+.

Faceted Search (Layered Search) on MySQL database with example.

Last few day I was searching for the layered search using MySQL. Layered Search is actually a Faceted Search. (Magento, a highly professional e-commerce platform on php name it Layered Search). Faceted Search can be done using two way MySQL/Any DB Application or using Apache Solr.

In this post I will show you how we can do Faceted search using MySQL database. You need a specific database schema, but it’s feasible. Here’s a simple example:

product Table

classification Table

product_classification Table

So, say someones search for paint, you’d do something like:

This would return both entries from the product table.

Once your search has executed, you can fetch the associated facets (filters) of your result using a query like this one:

This’ll give you something like:

So, in your result set, you know that there are products whose color are blue and red, that the only material it’s made from is latex, and that it can be found in departments home and paint.

Once a user select a facet, just modify the original search query:

So, here the user is searching for keyword paint, and includes two facets: facet blue for color, andhome for department. This’ll give you:

So, in conclusion. Although it’s available out-of-the-box in Solr, it’s possible to implement it in SQL fairly easily.


Thanks stackoverflow.com

Install Apache Solr on Windows with Wamp

Apache Solr is useful for Searching, Indexing, Faceted Search, Dynamic clustering. You can see full feature of Apache Solr Here. It is based on Apache Lucene Search Library and extends it. Here I will show you how to install Apache Solr on Windows and integrating it with WAMP Server. (Integration with WAMP is not mandatory if you are not using it)

The easiest way to install Apache Solr on Windows is to use Solr installer from BitNami. This can be found here http://bitnami.com/stack/solr. Download the installer and run it with administrative rights. Try to keep the installation path simple something like “c:/solr/” will be appropriate.

It will also install an Apache Server so if you don’t have WAMP or Apache already installed than its super easy, just go with the flow. If you already have WAMP installed than make this Apache listen on some available port  other than 80 (where WAMP ‘s Apache is listening).

Once the setup is complete Solr will be available for use in port selected during setup (see no big deal). Now if you have WAMP and you don’t want to have two Apache services running do the following steps.

  • Enable proxy_module and proxy_http_module via WAMP menu or directly from Apache conf file.
  • Open httpd.conf file and add following line at the end of the file

    Note that the path here should be correctly pointing to the solr.conf file. Use the path where you installed the Solr.
  • Now restart the WAMP Apache via WAMP menu. If it starts correctly than its cool, otherwise check if you have correctly enabled the said modules, and path to solr config file.
  • Now check http://localhost/solr/ this should show the dashboard for solr.
  • Remember the extra Apache service we need to disable it so it does not start automatically as we don’t need it. So goto Control Panel > Administrative Tools > Services , double click “solrApache” service and change its “Startup Type” to “Manual”. Now it will not start once your system is restarted.



Thanks to sphinxconsultant.com

Opencart – Category Carousel of Product

Category Product Carousel – Opencart is new Opencart extension module by TheDigiLife. Category Product Carousel – Opencart is very useful in displaying products of particular category in carousel. This Opencart module is easy to use as it looks like core Opencart module. This module not update any core files.

Category Product Carousel – Opencart supports multilanguage. You can visit this plugin on Opencart marketplace here. This module uses jQuery Carousel which comes bundled with Opencart installation so no extra file is added.

Category Product Carousel – Opencart is light weight module. Installation instruction are as follow.

  1. Download the zip file, extract somewhere on your computer. 
  2. From extracted file, upload the the files/folder under “upload” folder to server using FTP, in root folder (where admin,catalog,system folder are available) of Opencart installation 
  3. Go to admin area of you Opencart website and Click on Extension > Modules
  4. Install Category Product Carousel
  5. Edit Category Product Carousel
  6. At last add module on you desired page.

Below are the screenshots




You can download Category Product Carousel – Opencart Here

Opencart – Shopping cart in Pop Up and Buy Now Button

Recently we released new Opencart plugin named “Product Buy Now button and Cart in Popup – Opencart – VQMOD“. This is useful extension of Opencart for replacing the “Add to cart” button with “Buy Now” button. Clicking on Buy Now button opens shopping cart in popup. Popup shopping cart is fully functioned. User can change quantity, remove any product, Apply coupon code, etc. in popup itself.

Product Buy Now button and Cart in Popup – Opencart – VQMOD extension of Opencart makes your site User friendly and easy access to shopping cart. Shopping cart popup is displayed using Colorbox jQuery plugin popup. Colorbox jQuery comes bundled with Opencart installation so no extra file include.

This Opencart plugin is developed using vQmod so no core files will be changed. Installation is very easy.

This Opencart extension support multilanguage.

Here is the screenshot of extension.

You can download the plugin Here

OpenCart – Options Mouse Hover ToolTip Help

Recently new Opencart extension launched on Opencart market place. It is Options Mouse Hover ToolTip Help. Plugin is really cool and useful in showing ToopTip Text for product option in Opencart.

Opencart is E- Commerce / Shopping Cart  Open Source solution. Its stands on second place when comparing to similar solution like Magento, PrestShop etc.  OpenCart is really useful for medium businesses. It is a feature rich open source shopping cart solution.

Opencart is missing feature to add help text for Available Options for products. This plugin help administrator to add text from admin and show it to Customer for more information on Options.

This plugin can also be useful in showing some options Notes, disclaimer or simple information. Extension interface is really easy.

Also it supports “vqmod” so that no core file will be updated. You can find more information on vqmod here.

Visit the extension page on opencart market place. Click Here

Here are some screenshot of plugins.

Admin Multiple Value Tooltip

Admin Single Value Tooltip

Customer / Front end View


Build Custom Kernel in UBUNTU (With disabled USB and Bluetooth)

Today Lets make our own OS/Kernel, which doesn’t support USB and BLUETOOTH. After reading this article, you are able to make any kind of your kernel, like disabled graphics disabled Soundcard; you can also disable your CD-ROM, WLAN, MULTIMEDIA. In short you can make your own OS/Kernel as per your requirement. 

Here, we are going to make a kernel, which doesn’t support USB, Bluetooth. This kind of OS is mostly used in Cyber Cafe, Education Department, School or offices, at which security of data is very important. So let’s concentrate on our pretty interesting task: (yes, every tough task could be make easy by just make it interesting)

Ok, let’s start our process:

Step 1: Get Latest Linux kernel code 

Visit http://kernel.org/ and download the latest source code. File name would be Linux- x.y.z.tar.bz2, where x.y.z is actual version number. For example file linux-3.5.3.tar.bz2 represents 3.5.3kernel version. Download it on your desktop path now; you have kernel linux-3.5.3.tar.bz2 on your desktop

[Create a folder on desktop with a name (avoid space in name). suppose we make folder “jimit” (without quotes), copy your linux-3.5.3.tar.bz2 file in this folder]

Step 2: Open Terminal and direct your path

Open terminal (CTRL+ALT+T) and type a path of that folder in which you copied your kernel

After reaching to your folder, here it is “jimit”, you can check your kernel by just type a command: ls (it’s not required)

[NOTE: during whole process, you need not require to write $ or # symbol, you have to just type commands]

Step 3: Extract your kernel

Now, this kernel file is like a rar file, you have to extract this file for that type this command

[ Here, Linux -x-x-x means type your kernel version like Linux -3.5.3.tar.bz2,after typing this  command ,this file will be extracted on same folder.]

Now, after extracting this folder, go in to that extracted folder and type:

Step 4:  Kernel Configuration

Now type:

[if its not work,then you have to install ncurses library,for that just type:]

As you type this command, after little process one blue window will open

Here, for disable USB support, go on to device drivers and then in Submit space up to   when   * or M symbol is removed. For disable this supports, there must be a null before it.
[For back window, hit Esc key for two times]
same for Bluetooth just go in network support, and then in Bluetooth.hit space and disable it but giving it null. Now for save and exit, hit Esc key two times, and give yes for save & quit.
After extracting and support changes, type one another command

Type this command and sleep for 3 hours (dual core processor people),i3,i5 processor  people can sleep just for 1-2 hours. yes, if you have dual core processor or any old processor ,this process will take 3 hours, else it will take 1-2 hours.

Now wake up, process is almost done.

Step 5: Buildup Module

Now, type another command

Step 6: Become Root user

After all this commands, you have to become a root user, means you have an authority for doing any changes by commands, for that type this commands


As you type this, system will ask you for password, give it, and you can see $ symbol is replaced by # symbol, it means you are a root user, then type another command,

And then type last one

It’s done. Now just type

And system will restart. As you can see at the starting of system, you have an option of kernel, select your kernel (for here it is 3.5.3) and access it, in which you are not able to access your USB and BLUETOOTH.

Share and Comment if you like the post or Have any query.

Thanks, Good Day

Lock your Private Folder in Ubuntu

Hello everybody, Today we are going to learn that, how to lock our private folder, file in Ubntu in just few mins. It’s mainly used when we need to secure our important data from others.

Here,we just remove the permission read(r) ,write(w) and execute(x) of file, then it will automatically be locked, and for that we just need to write a few commands.

Before that lets make a folder xyz on desktop. We are going to lock this folder “xyz”. 

Step 1: Open terminal (CTRL+ALT+T)

Then go to on your folder path,here,our folder is on desktop.
Then type:

Step 2: cd Desktop

then type:

step 3: ls -l

Now,here you can see folder name “XYZ”,2nd line from bottom. [here,GREEN BOX]
Exactly in that first row, you can see like this
drwxrwxrwx ( it shows the permission of xyz file)
d = directory
r =read
x= execute.
Now, we want to lock this xyz file, means remove permission of read, write and execute
then just type:

step 4:  chmod 000 xyz

now go to that file, and try to open that file..

this is our file location,on which you can see like cross symbol,which indicates that you dont have permission to open this file. if you are trying to open this file, you will get error like this.

now to UNLOCK this folder,
type in terminal

step 5: chmod 777 xyz

after giving this command, you can see on folder that,cross symbol is magically removed, that means now you are able to access this folder.

So,in short,by this way you can lock any folders,files.

Overview of commands: 

  2. cd Desktop ( what ever your file location)
  3. ls -l
  4. chmod 000 xyz ( it will lock the file.)
  5. chmod 777 xyz (it will unlock the file)

WordPress Essential Plugins – Every Website Required

Plugins are tools to extend the functionality of WordPressWordPress Plugins allow easy modification, customization, and enhancement to a WordPress blog. Instead of changing the core programming of WordPress, you can add functionality with WordPress Plugins.

What is WordPress Plugins?

Here is a basic definition: A WordPress Plugin is a program, or a set of one or more functions, written in the PHP scripting language, that adds a specific set of features or services to the WordPress weblog, which can be seamlessly integrated with the weblog using access points and methods provided by the WordPress Plugin Application Program Interface (API).

SEO Related WordPress Essential Plugins

SEO is something which every site requires to make their business increase. SEO is a technique which helps search engines find and rank your site higher than the millions of other sites in response to a search query. SEO thus helps you get traffic from search engines.

WordPress SEO by Yoast

Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the WordPress SEO plugin by Yoast. WordPress SEO is the most complete and advanced WordPress SEO plugin that exists today. It incorporates everything from a snippet preview and page analysis functionality that helps you optimize your pages content, images titles, meta descriptions and more to XML sitemaps. This plugin helps you to optimize your page content, image titles, meta descriptions, comes with tons of other features like Robots Meta configuration, breadcrumbs, permalink cleanup, canonical link element support, and optimized post titles.

 All in One SEO Pack

All in one SEO WordPress PluginWordPress SEO plugin to automatically optimize your WordPress blog for Search Engines. Another free WordPress seo plugins which can be used to Optimizes your WordPress blog for Search Engines (Search Engine Optimization).

Comes with features to support google analytics,custom post types, Advanced Canonical URLs, Built-in API so other plugins/themes can access and extend functionality.

Google XML Sitemaps

This plugin will generate a special XML sitemap which will help search engines to better index your blog. Google XML Sitemaps plugin generates XML sitemaps for your WordPress website, so that it becomes easy for search engine crawlers like Google and Bing, to index your site better. It notifies all the major search engines when you create new content, helping your site be more thoroughly indexed.

SEO Friendly Images

SEO Friendly Images automatically adds alt and title attributes to all your images improving traffic from search engines. SEO friendly Images automatically adds alt and title attributes to your images. If your images inside post or page content don’t have alt or title attribute then this plugins adds them according to your plugins settings so images inside your content becomes seo optimized.

Broken Link Checker

This plugin will check your posts, comments and other content for broken links and missing images, and notify you if any are found. This plugin is very helpful to find all the broken links on your website. This plugin Monitors links in your posts, pages, comments, the blogroll, and custom fields (optional). Detects links that don’t work, missing images and redirects. Notifies you either via the Dashboard or by email.

WordPress Essential Any-Spam and Security Plugins

Every Website require to stop spamming. Stopping bot generated comments. Many Plugins are available to stop span. Here I have listed some good plugin available in WordPress.


akismetAkismet filters out your comment and track-back spam for you, so you can focus on more important things. Akismet is the best wordpress anti spam plugin to protect your website from web spam. Akismet plugin filters comments and trackback spam. It runs on autopilot and provides 24-hour protection. Akismet is the best automated spam killer that actually gets better as it learns.


SI CAPTCHA Anti-SpamAdds CAPTCHA anti-spam methods to WordPress on the forms for comments, registration, lost password, login, or all. For WP, WPMU, and BuddyPress. SI CAPTCHA Anti-Spam plugin prevents spam from automated bots by adding a CAPTCHA in comment, registration, login and lost password forms. So your websites comment,login and registration forms becomes more secure from spams.


WP-reCAPTCHAIntegrates reCAPTCHA anti-spam methods with WordPress including comment, registration, and email spam protection. reCAPTCHA is popular and widely accepted CAPTCHA systems on many websites. WP-reCaptcha plugin integrates reCAPTCHA anti-spam methods in WordPress as comment, registration forms and email protection.

Login LockDown

Login LockDown records the IP address and timestamp of every failed login attempt. If more than a certain number of attempts are detected within a short period of time from the same IP range, then the login function is disabled for all requests from that range. This helps to prevent brute force password discovery.

Better WP Security

Better WP Security

The easiest, most effective way to secure WordPress. Improve the security of any WordPress site in seconds. This plugin can Remove the meta “Generator” tag, Change the urls for WordPress dashboard including login, admin, and more, Completely turn off the ability to login for a given time period (away mode), Remove theme, plugin, and core update notifications from users who do not have permission to update them, Remove Windows Live Write header information, Remove RSD header information, Rename “admin” account, Change the ID on the user with ID 1, Change the WordPress database table prefix, Change wp-content path, Removes login error messages and Display a random version number to non administrative users anywhere version is used.

Essential Polls and Comments WordPress plugins



Reward your readers by automatically placing a link to their last blog post at the end of their comment. Encourage a community and discover new posts. CommentLuv Pro has even more amazing features that can bring even more traffic and comments to your blog by giving you the ability to fight spam, add keywords, integrate twitterlink, add a top commentators widget, social enticements and by having it installed on your site, you get advanced backlink features on EVERY CommentLuv blog when you comment (there are 10’s of thousands of CommentLuv blogs).

Facebook Comments For WordPress

Allows your visitors to comment on posts using their Facebook profile. Supports custom styles, notifications, combined comment counts, recent comments. This plugin integrates the Facebook commenting system (new, old or both) right into your website. If a reader is logged into Facebook while viewing any comment-enabled page or post, they’ll be able to leave a comment using their Facebook profile.

Disqus Comment System

Disqus Comment SystemDisqus, pronounced “discuss”, is a service and tool for web comments and discussions. Disqus makes commenting easier and more interactive, while connecting websites and commenters across a thriving discussion community.  The Disqus for WordPress plugin seamlessly integrates using the Disqus API and by syncing with WordPress comments.

Subscribe To Comments

Subscribe to Comments allows commenters on an entry to subscribe to e-mail notifications for subsequent comments. The plugin includes a full-featured subscription manager that your commenters can use to unsubscribe to certain posts, block all notifications, or even change their notification e-mail address!


Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress’s blog post/page. WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.

Essential Social WordPress Plugin


AddthisAddThis Share Buttons help drive traffic to your site by helping visitors share, bookmark and email your content to over 330 services. Get more traffic back to your site by installing the AddThis WordPress plugin.With AddThis, your users can promote your content by sharing to over 330 of the most popular social networking and bookmarking sites (like Facebook, Twitter, Pinterest, Google+ and LinkedIn).

ShareThis: Share Buttons and Sharing Analytics

ShareThis Share Buttons and Sharing AnalyticsQuick & easy sharing service that allows your users to share content – features Open Graph Sharing, Hovering Bar and CopyNShare! Increase social activity on your site with the ShareThis and ShareNow widgets. With access to 120 social channels (including Facebook, Twitter, Like, +1, Email and more), The ShareThis widget is a quick and easy sharing solution for your site to keep your audience engaged in your content and increase traffic to your site. You can also customize your widget for seamless integration to your site. You have the option to use small or large buttons, add counters and place the widget in a clear location for your users to share.


Sociable plugin adds a bar of icons of different social networking and bookmarking sites that you can choose for your articles. Using sociable plugin visitors of your website can easily share posts from your website on their social bookmarking accounts.

Essential Stats and Tracking Plugins

WassUp Real Time Analytics

WassUp Real Time AnalyticsAnalyze your visitors traffic with real-time statistics, a lot of chronological information, charts, a sidebar widget. WassUp is a WordPress plugin to track your visitors in real-time. It has a very readable and fancy admin console to keep track of your visitors that gives you a detailed view into almost everything your users are doing on your site. It is very useful for SEO or statistics maniacs.


Enable you to display how many users are online on your WordPress blog with detailed statistics. This plugin enables you to display how many users are online on your WordPress site, with detailed statistics of where they are and who they are (Members/Guests/Search Bots).

Count per Day

Count per DayVisit Counter, shows reads and visitors per page, visitors today, yesterday, last week, last months and other statistics. This plugin count reads and visitors, shows reads per page, shows visitors today, yesterday, last week, last months and other statistics on dashboard, shows country of your visitors, you can show these statistics on frontend per widget or shortcodes too.

Jetpack by WordPress.com

Jetpack by WordPress.comJetpack is a WordPress plugin that supercharges your self-hosted WordPress site with the awesome cloud power of WordPress.com. This plugin can Simple, concise stats with no additional load on your server. Previously provided byWordPress.com StatsEmail subscriptions for your blog’s posts and your post’s comments, Social networking enabled comment system, Likes, allowing your readers to show their appreciation of your posts, Monitor and manage your site’s activity with, Notifications in your Toolbar and on WordPress.com, Simple, Akismet-backed contact forms.

Google Analytics for WordPress

Google Analytics for WordPressTrack your WordPress site easily and with lots of metadata: views per author & category, automatic tracking of outbound clicks and pageviews. Simple installation through integration with Google Analytics API: authenticate, select the site you want to track and you’re done. This plugin uses the asynchronous Google Analytics tracking code, the fastest and most reliable tracking code Google Analytics offers. This plugin have option to manually place the tracking code in another location.

Other Essential Plugin for WordPress

Contact Form 7

Contact Form 7Contact Form 7 can manage multiple contact forms, plus you can customize the form and the mail contents flexibly with simple markup. The form supports Ajax-powered submitting, CAPTCHA, Akismet spam filtering and so on.


WordPress PopUp

WordPress PopUp allows you to display a fancy popup (powered as a popover!) to visitors sitewide or per blog, a *very* effective way of advertising a mailing list, sp. Good plugin to add popup ads or banners inside popup on your website. Comes with option to restrict popup from any particular page or posts.


nrelateNrelate display related content in a cool flyout box. nrelate is not just another related posts plugin. Patent-pending technology continuously analyzes your website content and displays other related posts from your website. This ultimately leads to higher page-views for your site, and a better user experience for your visitors.