Introduction to WP Rig (Part 1)

WP Rig is a theme development rig. We can define rig as something like a setup or a gear used for a particular purpose. WP Rig is an open-source project originally created by Morten Rand-Hendriksen with the support of LinkedIn Learning. We write PHP codes, CSS rules, JavaScript. We Rig optimizes our codes, minifies them.  […]

Open External Link in New Tab

You can open external link in new tab with few lines of jQuery. Make sure the jQuery library is loaded. The following script tests if the site and href domain is same. If not, link is open in new tab.

Note: It is better to load scripts in footer.

Replacing WP Cron with Cpanel Cron Job

Disable WP Cron. In your wp-config.php file add the following code

Log in to your site’s cpanel. Most of the times http://yousite.com/cpanel might work Once you are logged into cpanel, look for “Cron Jobs” and click it Once inside the Cron Jobs page, use the following command with your desired time settings

 

Update / Change recipient E-mail address in Contact form 7

Disabling Comments

When we don’t want any comments in our site we can use the “comments_open” filter to disable the comments for every post and pages.

Simple Example of implementing Walker_Nav_Menu Class

In reference to the WordPress Codex, the Walker class was implemented in WordPress 2.1 to provide developers with a means to traverse tree-like data structures for the purpose of rendering HTML. The detail information about the walker class can be found in the WordPress Codex. Here is a simple example.

In the above block of code, the wp_nav_menu() function takes $defaults as […]

Hook into Contact Form 7

Contact form 7 is a really amazing WordPress plugin developed by Takayuki Miyoshi available for download from http://wordpress.org/plugins/contact-form-7/ Some key features of contact form 7 are: Ajax Form Submission Multiple form Captcha Spam Filter Multilingual and many more. [gad] I am assuming here that you are familiar with Contact Form 7 or have used this plugin at least once […]