Get PHP and Shortcode to Work in WordPress Widgets
…// Use shortcode in a native PHP file <?php echo do_shortcode(‘http:myvideo.com’); ?> If the code is to be inserted inbetween HTML make sure you keep the PHP opening and closing…
Read MoreRemove WordPress Backend Dashboard Widgets
…Quick Press widget remove_meta_box(‘dashboard_recent_drafts’,’dashboard’,’side’); // Recent Drafts remove_meta_box(‘dashboard_secondary’,’dashboard’,’side’); // Other WordPress News remove_meta_box(‘dashboard_incoming_links’,’dashboard’,’normal’); //Incoming Links remove_meta_box(‘rg_forms_dashboard’,’dashboard’,’normal’); // Gravity Forms remove_meta_box(‘dashboard_recent_comments’,’dashboard’,’normal’); // Recent Comments remove_meta_box(‘icl_dashboard_widget’,’dashboard’,’normal’); // Multi Language Plugin remove_meta_box(‘dashboard_activity’,’dashboard’, ‘normal’);…
Read MoreFilter WooCommerce orders by payment gateway
…will see a column that allows you to choose a payment gateway and then filter the orders to show only those that have been paid via the gateway. https://gist.github.com/neilgee/8b4c3a3fa91d7e74b7fbde04e4e94fce…
Read MoreRedirect a Custom Post Type’s Single and Archive Pages in WordPress
…Alternatively redirect the single pages to their archive view… add_action( ‘template_redirect’, ‘prefix_redirect_single_cpt’ ); // Redirect Testimonials CPT Singles function prefix_redirect_single_cpt() { if ( is_singular( ‘testimonial’ )) { wp_redirect( ‘/testimonials’, 301…
Read MoreRename Home name and link in WooCommerce Breadcrumbs
…Change WooCommerce Home URL in Breadcrumb For the URL… add_filter( ‘woocommerce_breadcrumb_home_url’, ‘prefix_custom_breadrumb_home_url’ ); /** * Replace the home link URL in WooCommerce breadcrumb */ function prefix_custom_breadrumb_home_url() { return ‘https://example.com.au/mynew-url/’; }…
Read MoreAnchor Link Offset to Other Pages with Fixed Header Size
…appears further down below the header of further down the page. The code snippet is documented. https://gist.github.com/neilgee/322e06c3e9dea0cc7d41bb70f2736989 If you know the pixel dimensions instead you can add the number as…
Read MoreChange WooCommerce SKU text to another label
You can change WooCommerce SKU text to another label using the gettext filter add_filter(‘gettext’, ‘translate_woocommerce’, 10, 3); /** * Change SKU Label * @link https://gist.github.com/dannyconnolly/da6f1a2d95dc826ccdcd * @since 1.0.0 */ function…
Read MoreHide Amount of Items from Add to Cart Message in WooCommerce
…the below code snippet to your functions.php https://gist.github.com/neilgee/e037ee587b318a7e7369359ec48c39d6 On line 24 a ternary operator has been removed which displayed the quantity if greater than 1 – now when you add…
Read MoreSend Full Product Details over WooCommerce Webhook Action Hook
…https://gist.github.com/neilgee/5f60654d2583895e154729384cb51331#file-webhook-php Using this function and changing the webhook ID and data source will now return the full data to the webhook. Where to find webhook ID Now the full order…
Read More