Output Beaver Builder CPT Posts in a Module that belong to a Custom Taxonomy

Beaver Builder Custom Taxonomy

Using Beaver Builder loop modules to output posts can be limited when you want to output a CPT that belongs to multiple custom Taxonomies but you only want posts to display from one taxonomy – this can be achieved in code using the fl_builder_loop_query_args filter. View the code on Gist. In the above code snippet…

Read More

Limit the Words in WooCommerce Product Short Description

Woocommerce Product Short Description

WooCommerce has a filter that can limit the words in a product short description field  called ‘woocommerce_short_description‘ – coupled with an existing WordPress function ‘wp_trim_words‘ we can make the description any length to suit teasers, sliders etc and leave other areas where we want the full short description. View the code on Gist. In the…

Read More

Override the Beaver Builder LightBox Plugin

Here is a quick guide on how to override the Beaver Builder Lightbox plugin in which you may wish to run another lightbox plugin instead. If you are using the Beaver Builder plugin, then add in your theme’s function.php add_filter( ‘fl_builder_override_lightbox’, ‘__return_true’ ); Additionally, if you are running the Beaver Builder Theme then you need…

Read More

Change WooCommerce Variation Dropdown Text

Woocommerce Dropdown Variation Text

You can change the default text in the product variation dropdown from ‘Choose an option‘…. to something else with the ‘woocommerce_dropdown_variation_attribute_options_args‘ filter. Add in your functions.php add_filter( ‘woocommerce_dropdown_variation_attribute_options_args’, ‘bt_dropdown_choice’ ); // /** * Change the custom dropdown “Choose an option” text on the front end */ function bt_dropdown_choice( $args ){ if( is_product() ) { $args[‘show_option_none’] =…

Read More

Remove WooCommerce SKU: N/A Category in Products

Remove Woocommerce Sku

You can remove the WooCommerce sku line – SKU: N/A Category from products in WordPress by using the ‘wc_product_sku_enabled‘ filter. Just add in your theme’s functions.php file… add_filter( ‘wc_product_sku_enabled’, ‘__return_false’ ); This will remove the sku everywhere. Remove the SKU Item Conditionally You may want to keep the SKU info published on some categories or products only – you…

Read More

Show All Loaded Scripts and Styles on a Page in WordPress

Scripts Styles On Page

To show all loaded scripts and styles on a page in WordPress you can use a foreach loop and show the name of the script as referred to as a $handle add_action( ‘wp_print_scripts’, ‘prefix_show_me_the_scripts’ ); /** * Show what Scripts and Styles are running on a page */ function prefix_show_me_the_scripts() { global $wp_scripts; global $wp_styles; echo…

Read More

Styling Default Select DropDown Fields

style-select-dropdown

The default dropdown select field form element is difficult to style in CSS alone – it needs a bit of jQuery love, here is a guide to add some cleaner styling to change default dropdown sort select fields.   Then one with some jQuery magic… Using select2.js So the above select field was transformed by…

Read More

jQuery Document Ready Function For WordPress

Document Ready Wordpress

You can set up a jQuery document ready function for use with WordPress and use the jQuery library that WordPress ships with rather than use another one. Here are three ways to use jQuery document ready function with WordPress. Usually, a jQuery document ready function is expressed as below. $(document).ready(function(){ }); jQuery document ready 1st…

Read More