Blog

  • WooCommerce

    Automatically apply a coupon to logged in users

    Force apply a permanent coupon to logged-in WooCommerce users to provide a client discount. One way to provide a discount to logged in users would be to dynamically modify the product prices, how ever this method doesn’t show as a discount in a WC Order. Here is a method that applies the discount as a…

    Read more

  • WordPress

    Display featured images in WordPress admin

    Instead of installing another plugin for a small quality of life feature use a simple snippet to display post featured image thumbnails in WordPress admin dashboard. This minimal snippet can be added to your child theme’s functions.php to display post featured images in wp-admin on the edit.php page for posts or custom post types added…

    Read more

  • WooCommerce

    Dynamic checkout fields based on selected shipping method

    By default WooCommerce checkout includes fields for address, post code, city and state, how ever when using a shipping method such as “Local pickup” there is no need to collect client address information. Here’s some custom code that can be used to dynamically hide certain WC checkout fields based on which shipping method is selected.…

    Read more

  • WooCommerce

    WooCommerce discount for logged-in users

    An example of custom code that provides a discount for all logged-in users. The code should ideally be placed in a file in your child theme’s directory and you can then include it from your child theme’s functions.php.If you’re not using a child theme you can use mu-plugins instead. Let’s start off with a simple…

    Read more

  • WooCommerce

    Displaying WooCommerce products with shortcodes

    While WordPress has the block editor and various blocks for displaying WooCommerce products, shortcodes are still a popular method for displaying lists of WC products because unlike blocks they use consistent styling provided by the theme, instead of hard-coded styles that WC blocks use. Here is a reference of the most common shortcodes for displaying…

    Read more

  • WordPress

    Create a new file using the WordPress theme editor

    The WordPress theme editor provides the ability to make modifications to theme files directly within the WordPress admin dashboard. WordPress includes two native editors that enable direct editing of theme files from your browser. These are referred to as the Theme file editor and the Plugin file editor. Where is the editor? How do I…

    Read more