add referrer to woo

The code in the original article is broken, and would’ve been broken when it was written. So being outdated is not the problem (2 years is nothing in WordPress time). The issue is this line: add_action(‘woocommerce_checkout_update_order_meta’, ‘add_referral_meta’); The callback function they’ve created, add_referral_meta(), accepts two arguments, $order_id and $posted: function add_referral_meta( $order_id, $posted ) { … Read more

get_current_site() is undefined

get_current_site() is a function for getting the current Multisite Network. As with other multisite-related functions, it is not available to use if your site is not configured as a multisite network. I can’t tell from your code what you’re attempting to use the function for, so I can’t offer a suggestion for what to use … Read more

Enable right click on WordPress site

This isn’t something WordPress is doing but probably your theme. Perhaps it’s an attempt to get people to not download your images or code, this is basically useless and doesn’t prevent anything like that. Your theme might be using something similar to this… document.addEventListener(‘contextmenu’, event => event.preventDefault()); Try searching your theme files for contextmenu and … Read more

Personalize checkout text

If you look at the WooCommerce docs, you’ll see that you can override template parts by having a replacement file in a woocommerce folder in your theme. A lot of the text you’re talking about is hardcoded into woocommerce > templates > checkout > review-order.php Copy that file and modify as needed. Normally I would … Read more

Woocommerce image sizes missing from Appearance › Customize but not declared by theme

WooCommerce itself registers support for the default themes. For Twenty Fifteen it registers the following: add_theme_support( ‘wc-product-gallery-zoom’ ); add_theme_support( ‘wc-product-gallery-lightbox’ ); add_theme_support( ‘wc-product-gallery-slider’ ); add_theme_support( ‘woocommerce’, array( ‘thumbnail_image_width’ => 200, ‘single_image_width’ => 350, ) ); This is why those settings are not in the Customiser. However, regardless of what theme support is registered, the gallery_thumbnail_image_width … Read more

Defined function isn’t showed on page

There’s no relationship between how the function is written, and how you’re attempting to use it. The first problem is that your function returns a value, rather than echoing it. So if you wanted to output the value you need to use echo: echo social_sharing_buttons(‘post’); But the usage of ‘post’ doesn’t make sense here. Your … Read more

Strip div From Excerpt

If it’s just needed in one place, you could use the following: echo wp_strip_all_tags( get_the_excerpt() ); Keep in mind, using the custom excerpt field will automatically remove all tags. Creating an excerpt automatically from the post content will not. If you want more control, you can use wp_trim_excerpt() or wp_trim_words(). See: Using wp_trim_excerpt to get … Read more