Blogs

Here you'll find solutions to some of the common problems you may have encountered during development as well as quick start code snippets to help you get started with popular frameworks.

MVC Architecture in PHP

MVC is acronym for Model View Controller. It is an architectural pattern standard. Instead of writing all the php code and html markup in one file we segregate it. So say in a typical MVC framework there will be three folders: Model View Controller Here is what each one of them will be doing The […]

Install Composer on Windows and WAMP Server

Composer is a dependency manager tool. Nowadays every other PHP package available out there is using composer for installing. Gone are the old days when developers use to require the required files for including a package. With composer you just need to add the package name in composer.json and composer will not only download the […]

Install Laravel 5 on WAMP Server

In this super small tutorial we’ll learn how to install Laravel 5 on WAMP server. It is assumed that you have a basic knowledge of WAMP. I am using Windows 7 Operating system. In case you are using Windows 8 or 10 or even a XP, the installation steps will remain the same. For installing […]

Highlight searched terms in WordPress search results

You can make your WordPress blog more user friendly by highlighting the search terms on Search page when user searches for something. By default WordPress search template is designed to show only the page title and excerpt. Unless and until the theme provides this feature out of the box, the searched terms are not highlighted […]

Laravel pagination for custom queries

If you have used laravel for any CRUD application you may used the paginate method on you query builder for generating pagination links. However this method doesn’t work well with groupBy and raw queries. This post shows few examples of generating pagination manually using the Paginator class.

Creating a simple responsive wordpress theme from scratch using Twitter Bootstrap: Part 2

In the last part of this tutorial we started with our theme with just two files: index.php and style.css. What we got was a terrible looking website that looked like a notepad text editor. In this part we are going to style our theme to give it a professional look. Below is what it is […]

Masonry style WordPress Gallery without using plugin

Nowadays Masonry styled Gallery layouts are very common for websites. There are many third party WordPress plugins for Galleries that either provide their own Gallery or provide styling skins for the default WordPress Gallery. For the sake of this post we will learn how to apply Masonry Layout to default WordPress Gallery. Below is the […]

WordPress on localhost asking Ftp details while downloading plugins from Dashboard

Many times while on your local server you may have faced this issue. You try downloading and installing a plugin through the Dashboard. Then all of a sudden a screen comes that asks for FTP credentials. If you usually manually extract the plugins zip file in the plugins folder then probably you must have never […]

Php function to convert an array to CSV file for download

Many times your PHP application may require downloading records from a database table. PHP MySQL select queries return result in associate array format (using mysqli_fetch_assoc or mysqli_result::fetch_assoc). This function can be used to convert the result array into a CSV file. And then force download the generated CSV file.

Sending html mails with attachment using PHP mail

The mail function of PHP can be used to send mails with attachment just by modifying the header data and changing the Content type. This blog explains how to do it.

Tutorial on creating image captcha in PHP using GD library

There are already a number of free captcha libraries available on web. But as a developer you might want to know (in case you don’t) how the captcha is actually generated. So in this small tutorial we will learn step by step how to generate a captcha image using PHP. Captcha is a string of […]

Using wpdb in core PHP non WordPress Projects

If you are a WordPress developer you would definitely be aware of the $wpdb variable. $wpdb makes it easy to query any table in your database and handle the result data as an array with column names as keys or as an object with properties as column names. $wpdb also provides the prepared statement for […]

Modified wpdb class for using in Core PHP

The original wp-db class that WordPress provides cannot be used in non WordPress projects. This blog provides the source code for a modified wp-db class that can be used in any non WordPress projects. Using this modified wp-db class file you can use the usual wpdb functions in your core PHP projects.

Creating a WordPress plugin for social media sharing

As the official WordPress codex explains, a WordPress plugin is a set of functions that adds or enhances the set of features to your WordPress blogs. Plugins can be activated and deactivated through the Plugins screen in WordPress dashboard. If you are a PHP programmer and new to WordPress and wish to know how plugins […]

Modifying WP Query for Advance Search in WordPress

Many times you need to provide a search input for your site that will search through custom fields, comments, categories and many more. However the default WordPress Search searches only through the post and pages content and title. This post shall show how to define your own custom search query.