Home

Welcome to WP Freelance, the best collection of WordPress code, guides and information to make awesome WordPress sites, especially for freelancers.


Latest posts

WooCommerce Update Checklist

WooCommerce is a powerful but complex system, and larger installations often have some additional plugins or custmisations. After updating the WooCommerce plugin, or any other related plugins, it’s important to test your store to ensure everything works as expected and any bugs are identified and fixed. Here’s a handy list to help get your store…

Continue Reading WooCommerce Update Checklist

How to change menu items to sentence case in WordPress

// Update menu items to sentence case add_action(‘wp_loaded’, ‘fl_update_menu_items_case’); function fl_update_menu_items_case() { // Get all of the menu item posts $all_posts = get_posts([ ‘posts_per_page’ => -1, ‘post_type’ => ‘nav_menu_item’, ]); // Loop each one setting the title case foreach ( $all_posts as $single ) { wp_update_post([ ‘ID’ => $single->ID, ‘post_title’ => ucfirst( strtolower( $single->post_title )…

Continue Reading How to change menu items to sentence case in WordPress

Change Default Image Size on Visual Composer Single Image

The Visual Composer Single Image component defaults the Image Size to ‘thumbnail’. This really isn’t very useful, especially if your clients are using Visual Composer to build pages. An Image Size of ‘large’, ‘medium’, or even a custom image size, is much more useful. If you’ve set ‘large’ to be the same width as your main content…

Continue Reading Change Default Image Size on Visual Composer Single Image

Set src using just CSS

Sometimes we need to change the src of an <img> element, but we don’t have access to the HTML, like when styling a plugin. But, CSS is our friend here, and we can use the url pseudo element to set the <img> src. <style> .my-class { content:url(“http://imgur.com/SZ8Cm.jpg”); }</style><img class=”my-class”> Check out this JSFiddle. Should work in…

Continue Reading Set src using just CSS

Change Default Image Size on Visual Composer Single Image

The Visual Composer Single Image component defaults the Image Size to ‘thumbnail’.  This really isn’t very useful, especially if your clients are using Visual Composer to build pages. An Image Size of ‘large’, ‘medium’, or even a custom image size, is much more useful. If you’ve set ‘large’ to be the same width as your main content…

Continue Reading Change Default Image Size on Visual Composer Single Image

Assign a Tag to a Contact in Infusionsoft using Affiliates Pro

If you’re using Affiliates Pro, and Infusionsoft, you might want to tag the Infusionsoft contact for an affiliate, once they have signed up. Here’s a handy function to do that. Important: You need to installed the Infusionsoft SDK plugin first (or add the SDK to your theme yourself). // Affiliate added add_action( ‘affiliates_added_affiliate’, ‘my_affiliates_added_affiliate’ ); function my_affiliates_added_affiliate(…

Continue Reading Assign a Tag to a Contact in Infusionsoft using Affiliates Pro