November 3rd, 2016 by admin
Showing prices without VAT based on roles Function that will check for user role and turn off VAT/tax for that role [php] function wc_diff_rate_for_user() { // check for the user role if ( is_user_logged_in() && current_user_can( ‘wholesale_customer’ ) ) { // set the customer object to have no VAT WC()->customer->is_vat_exempt = true; } } add_action( […]
September 21st, 2016 by admin
Adding this snippet to the functions.php of your wordpress theme will automatically create a meta description from your wordpress post striping out all shortcodes and tags. Make sure you have in the header.php of your wordpress theme or this snippet will not work. [php] function create_meta_desc() { global $post; if (!is_single()) { return; } $meta […]
August 11th, 2016 by admin
A lot of sites have custom profile pages (not the general one you find in the WordPress admin > Users > Your Profile/Edit My Profile). Profile After building an awesome edit profile page – your users log in, see the WordPress admin bar, click “Edit My Profile” and they end up at the WordPress general […]
August 10th, 2016 by admin
Here is a simple solution I figured out [php] function my_edit_toolbar($wp_toolbar) { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘parent’ => ‘user-actions’, ‘id’ => ‘new_media’, ‘title’ => __(‘Profile Edit’), ‘href’ => um_edit_profile_url( ”) ) ); } add_action(‘admin_bar_menu’, ‘my_edit_toolbar’, 999); [/php]
August 9th, 2016 by admin
First, we want to overwrite the “Howdy”. Add these lines in the functions.php of your theme. [php] function howdy_message($translated_text, $text, $domain) { $new_message = str_replace(‘Howdy’, ‘Welcome’, $text); return $new_message; } add_filter(‘gettext’, ‘howdy_message’, 10, 3); [/php] The above function replaces the “Howdy” with “Welcome” using the PHP str_replace function and applies the function through the WordPress […]