In WooCommerce I need to modify the thankyou.php page [closed]

I ended up inserting the payment description. (the one you specify in the woocommerce settings in the WordPress backend) The “native” build-in woocommerce payment-text is static and doesn’t relates to the actual selected payment method. 🙁 I did this by modifying the woocommerce template file: 1: Copy this template file: ..wp-content/plugins/woocommerce/templates/checkout/thankyou.php to your-theme-folder/woocommerce/checkout/thankyou.php 2: Replace … Read more

Create Custom URL structure for specific Post category

Try these steps: Step #1: Replace this: add_action(‘generate_rewrite_rules’, ‘custom_rewrite_rules’); function custom_rewrite_rules( $wp_rewrite ) { $regex = ‘/[\s\S]/’; $new_rules = array( trailingslashit(‘testimonials/’.$regex) => ‘/?p=’. get_page_by_path(‘$matches[1]’, OBJECT, ‘post’)->id ); $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; return $wp_rewrite; } ..with this one: add_action( ‘init’, ‘custom_rewrite_rules’ ); function custom_rewrite_rules() { add_rewrite_rule( ‘testimonials/([^/]+)(?:/([0-9]+))?/?$’, ‘index.php?category_name=testimonials&name=$matches[1]&page=$matches[2]’, ‘top’ // The rule position; either ‘top’ … Read more

Formating the_terms() function output

While you can specify separators and such in the_terms() arguments, it assumes that you actually want links. You can discard unwanted HTML by using filter: add_filter(‘the_terms’, ‘no_terms_links’, 10, 2); function no_terms_links($term_list, $taxonomy) { if (‘type’ == $taxonomy) return wp_filter_nohtml_kses($term_list); return $term_list; } Or just use deeper get_the_terms() function and iterate through its return to build … Read more

Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?

EDIT: this solution is not a best-practice. Please use the solution submitted by Nathan below! Use the WPMU_PLUGIN_DIR and WPMU_PLUGIN_URL constants 🙂 function load_my_alerts(){ wp_register_script( ‘my_alerts’, WPMU_PLUGIN_URL . ‘/js/alerts.js’, array( ‘jquery’ ) ); wp_enqueue_script( ‘my_alerts’ ); } add_action(‘admin_enqueue_scripts’, ‘load_my_alerts’);

Warning/Notice about functions.php

‘;)’ => ‘icon_wink.gif’, is in line 2477 in the current version, you should never just change or delete core files, unless you know how to run a private branch of WordPress. Line 2925 is the second trigger_error() in this function: function _deprecated_argument( $function, $version, $message = null ) { do_action( ‘deprecated_argument_run’, $function, $message, $version ); … Read more