Add WooCommerce order count column to Users admin page

/** * Add WooCommerce order count column to Users admin page. */ // Add column. add_filter( ‘manage_users_columns’, function( $columns ) { $columns[‘wc_order_count’] = ‘Orders’; return $columns; } ); // Populate column. add_filter( ‘manage_users_custom …

Read more

Align button to bottom in Elementor CTA widget

Add this custom CSS to the parent section/container:   selector .elementor-widget-wrap{ align-content: stretch; } selector .elementor-widget-call-to-action .elementor-widget-container{ display: flex; height: 100%; } selector .elementor-cta{ flex-d …

Read more

Contact Form 7 CSS to make a form full width

.wpcf7 {width:100% !important;} .wpcf7-form {width:100% !important;} .wpcf7-form label {width:100% !important;} .wpcf7-form input[type=”text”], .wpcf7-form input[type=”email”], .wpcf7-form input[type=”url”], .wpcf7-form input[type=”password”], .wpcf7-f …

Read more

Add messages to WooCommerce emails

function sws_woocommerce_email_order_details ($order, $sent_to_admin, $plain_text, $email) { if ($email->id == ‘customer_processing_order’) { ?><p><?php _e( “If you would like to receive exclusive emails with discounts and product inform …

Read more

Register new endpoint to use for My Account page

/** * @snippet WooCommerce Add New Tab @ My Account * @how-to Get CustomizeWoo.com FREE * @author Rodolfo Melogli * @compatible WooCommerce 3.5.7 * @donate $9 https://businessbloomer.com/bloomer-armada/ * Ref: https://www.businessbloomer.com/woocommerc …

Read more

MailPoet custom shortcode

e.g. a shortcode to display previous month:   // Custom MailPoet shortcode to show last month add_filter(‘mailpoet_newsletter_shortcode’, ‘sws_mailpoet_shortcode_for_last_month’, 10, 6); function sws_mailpoet_shortcode_for_last_month($shortcode, $ …

Read more

Add htaccess to admin-ajax

This would be to allow gravity forms to save as new posts which the htaccess is switched on.   // Temporary due to htaccess protection add_filter( ‘http_request_args’, ‘http_request_args_basic_auth’, 10, 2 ); function http_request_args_basic_auth( …

Read more

Gravity Forms – Make a datepicker’s availability dependant on a different datepicker field

Javascript: gform.addFilter( ‘gform_datepicker_options_pre_init’, function( optionsObj, formId, fieldId ) { if ( formId == 1 && fieldId == 1 ) { optionsObj.minDate = 0; optionsObj.onClose = function (dateText, inst) { jQuery(‘#input_1_2’).datep …

Read more

Add Order Column to Post Type

/* Add Menu Order column to Admin list for CPTs ——————————————————–*/ function add_new_hire_column($hire_columns) { $hire_columns[‘menu_order’] = “Order”; return $hire_columns; } add_action(‘manage_edit-!?POSTTYPE?! …

Read more

CSS to hide text on header phone/email address

@media screen and (max-width: 767px) { .sws-header-contact .elementor-icon-list-text { display: none !important; } }  

Read more

Remove unwanted woocommerce account page links

// Remove unwanted pages from Account page add_filter ( ‘woocommerce_account_menu_items’, ‘misha_remove_my_account_links’ ); function misha_remove_my_account_links( $menu_links ){ unset( $menu_links[‘downloads’] ); // Disable Downloads return $menu_lin …

Read more

Add Clarity to website

/* Add Clarity Code to wp_head() */ function sws_clarity_code() { ?> <!– Clarity Code –> <script type=”text/javascript”> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async …

Read more

Hiding items for logged out users

You may want to demo certain aspects or elements of website to clients before allowing it to be viewed by members of the public. Let’s say you have a number of new pages you want to demo and wish for the client to be able to navigate through these page …

Read more

Building Icon

A shortcode is used to display a black building icon which can be used as an icon for contact information

Read more

Phone Icon

A shortcode is used to display a black telephone icon which can be used as an icon for contact informtion

Read more

Envelope Icon

A shortcode is used to display a black envelope icon which can be used as an icon for contact information

Read more

Register a basic Custom Post Type

// Register our Team post type add_action( ‘init’, ‘create_custom_post_type’, 0 ); function create_custom_post_type() { // Set UI labels for custom post type array( ‘name’ => _x( ‘CPT Name’, ‘Post Type General Name’ ), ‘singular_name’ => _x( ‘CPT …

Read more

Register a Custom Post Type in detail

// Register our Team post type add_action( ‘init’, ‘create_custom_post_type’, 0 ); function create_custom_post_type() { // Set UI labels for custom post type $labels = array( ‘name’ => _x( ‘CPT’, ‘Post Type General Name’ ), ‘singular_name’ => _x( …

Read more

Adding a Column to Taxonomy

/* To add Term ID column to document types */ function sws_add_custom_column_to_terms_list( $columns ){ $columns[‘term_id’] = ‘ID’; return $columns; } add_filter( ‘manage_edit-{TAXONOMY-SLUG}_columns’, ‘sws_add_custom_column_to_terms_list’ ); function …

Read more