Automatically Add ALT+TITLE to Images in the_content() output

This will automatically assign the ALT & TITLE attributes to <img> elements that miss those. The value will be the post title ( aka get_the_title() );  

3rd Party Integration: Add Geolocation To Service Posts

Copy this code to your theme’s functions.php and each call your ‘3rd party integrations’ plugin will make after a visitor submission (For CRMs API, for example), it will include the Country, City & State of the visitor by his IP address.  

How To Add Checkbox To Checkout in WooCommerce

This is how you add a checkbox to checkout in Woocommerce. The Checkbox will appear in the checkout is not required (optional). Add this code to your theme’s functions.php file: See also: Add Checkbox To Woocommerce (Required Checkbox) See also: Add Multiple Required Checkbox Fields On WooCommerce Checkout Page

WPML: Fix Duplicate Hreflang Tags

Paste this into your theme’s functions.php file to prevent from Hreflang tags to appear on the same current language and fix duplicates.

Add NoFollow (rel=”nofollow”) To WordPress Tags Cloud

This is how you add rel=”nofollow” to tag links in the tag cloud using wp_tag_cloud(). Add it to your theme’s functions.php.

Remove HREF attribute from Empty Anchor Link on WordPress Menu

Add the following code to your theme’s functions.php file to remove the HREF attribute from all the links that link to “#”, Basically can be very useful if you’re using submenus and you want the parent item unlinked, for example.

Integrate HasOffers (By Tune) With WooCommerce

In this post I will include my code to track, store and pass HasOffers (affiliate id + transaction id + amount of order) data from the the first page, through the order details and back to HasOffers when the purchase is successfull. I will divide the process to a few steps: Track the Transaction ID […]

Prevent Contact Form 7 (CF7) From Sending Email

Put it in your theme’s functions.php and update the form id (999999) to your CF7’s form ID.

Integrate With MailChimp API With This Simple PHP Code

Integrating your website with MailChimp is easily done with this code. You can connect it with any form that’s processed with PHP.

Change Any Button, Input & Text With 1 Function (Also For WooCommerce)

How many times did you encounter a “Add to Cart” button or “View Cart” button on your WooCommerce website and you wanted to change it to something else, and didn’t know how? In this code snippet we can change any string we want (as long as it’s not a string with variables, it may be […]

WordPress Error Log 3 Code Lines Alternative with PHP

Debugging WordPress error can be sometimes a tough mission. For that, we can use that simple code to create error log file in the website’s root. Paste this into your wp-config.php: Once an error is occurred, it will create the error log file named error_log.txt with a full report of that error. Warnings will also […]

How To Add/Edit/Remove Custom Posts Columns In Posts Screen

This snippet is one of the most useful I’ve ever used. It allows you to fully customize the shown columns in the posts screen, whether it’s a regular ‘post’ type or a custom one. Adding a new column Step 1/2 – add the column to the column list & set its label Line 1:┬ámanage_post_posts_columns = […]

How To Get The Real Visitor’s IP With PHP

The following function will return the visitor’s IP address: Usage: