• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WordPress Tips, Code Snippets, and How To Tutorials

  • Home
  • Blog
  • Tips
  • Snippets
  • Tutorials
  • Contact

Blog

How to disable the visual editor in WordPress when editing pages or posts

November 12, 2019 by admin Leave a Comment

On your WordPress website you may want to disable the visual editor when you are editing page or posts on the website. That would be something you may want to do if you want to use the text or html editor.

Disable visual editor in WordPress

  1. From the WordPress admin left menu you can click on users > your profile
  2. From the profile page the first option is often to disable the visual editor
  3. You can then click that option
  4. You can then save the update
  5. Now if that worked for you it would disable the visual editor on your WordPress website on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: WordPress Tips Tagged With: Editor, WordPress Admin, WordPress Settings

How to update the shop page title on WooCommerce on WordPress

November 12, 2019 by admin Leave a Comment

If you are using WooCommerce for the ecommerce store on your WordPress website you may want to update the shop page title to a different title. You can do that without a plugin if you then add this code to your functions.php file. We recommend that you backup your WordPress website before you make updates on there.

Update WooCommerce shop page title

/**
 * New WooCommerce shop page title
 *
 * @author WPSnacks.com
 * @link https://wpsnacks.com/
 */
function new_shop_page_title( $page_title ) {
	if( 'Shop' == $page_title) {
		return "YOURTEXTHERE";
	}
}
add_filter( 'woocommerce_page_title', 'new_shop_page_title');

You can then replace the YOURTEXTHERE with the text you want for the new shop page title. Now if that works for you it would update the page title for the shop page on WooCommerce on your WordPress website on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, WooCommerce

How to hide the product count in category list view on WooCommerce on WordPress

November 12, 2019 by admin Leave a Comment

When you use WooCommerce for the ecommerce on your WordPress website you may want to hide the product count in the category list view on the website. To do that without a plugin you can then add this code to your functions.php file. We recommend that you backup your WordPress website before you make updates the file on there.

Hide WooCommerce product count on category list view

/**
 * Hide WooCommerce product count on category list view
 *
 * @author WPSnacks.com
 * @link https://wpsnacks.com/
 */
function woo_remove_category_products_count() {
	return;
}
add_filter( 'woocommerce_subcategory_count_html', 'woo_remove_category_products_count' );

Now if that works for you it would remove or hide the product count on category list view on WooCommerce on your WordPress website on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Categories, Functions.php, WooCommerce

How to update the out of stock text with custom text on WooCommerce on WordPress

November 12, 2019 by admin Leave a Comment

If you are using WooCommerce for the ecommerce on your WordPress website you may want to update the out of stock text to different custom text like sold or something like that. To do that without a plugin you can then add this code to your functions.php file. We recommend that you backup your WordPress website before you make updates the file on there.

Update out of stock text on WooCommerce

/**
 * Update WooCommerce out of stock text
 *
 * @author WPSnacks.com
 * @link https://wpsnacks.com/
 */
function availability_filter_func($availability)
{
	$availability['availability'] = str_ireplace('Out of stock', 'YOURTEXTHERE', $availability['availability']);
	return $availability;
}
add_filter('woocommerce_get_availability', 'availability_filter_func');

You would then replace YOURTEXTHERE with the text you want like sold or something like that. Now if that works for you it would update the out of stock text in WooCommerce on your WordPress website on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, WooCommerce

How to allow shortcodes in product excerpts on WooCommerce on WordPress

November 9, 2019 by admin Leave a Comment

On your WordPress website that uses WooCommerce for ecommerce you may want to allow shortcodes in the product excerpts on there. To do that without a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates the file on there.

Update to allow shortcodes in product excerpts on WooCommerce

/**
 * Update to allow shortcodes in product excerpts
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
if (!function_exists('woocommerce_template_single_excerpt')) {
   function woocommerce_template_single_excerpt( $post ) {
   	   global $post;
       if ($post->post_excerpt) echo '<div itemprop="description">' . do_shortcode(wpautop(wptexturize($post->post_excerpt))) . '</div>';
   }
}

Now if that works for you it would allow shortcodes in WooCommerce product excerpts on your WordPress website on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Shortcodes, WooCommerce

How to add a minimum order amount to WooCommerce on WordPress without a plugin

November 9, 2019 by admin Leave a Comment

If you are using WordPress for your website with WooCommerce for ecommerce you may want to have a minimum order amount for product orders on there. If you want to do that without a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates the file on there.

New minimum order amount for WooCommerce

/**
 * New minimum order amount
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
function new_minimum_order_amount() {
    $minimum = #;

    if ( WC()->cart->total < $minimum ) {

        if( is_cart() ) {

            wc_print_notice( 
                sprintf( 'Your order total is %s — you need an order with a minimum of %s to place your order ' , 
                    wc_price( WC()->cart->total ), 
                    wc_price( $minimum )
                ), 'error' 
            );

        } else {

            wc_add_notice( 
                sprintf( 'Your order total is %s — you need an order with a minimum of %s to place your order' , 
                    wc_price( WC()->cart->total ), 
                    wc_price( $minimum )
                ), 'error' 
            );

        }
    }
}
add_action( 'woocommerce_checkout_process', 'new_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'new_minimum_order_amount' );

Then you can replace the # for the minimum. Now if that works for you it would add a minimum order amount to WooCommerce orders on your WordPress website on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Orders, Payments, WooCommerce

How to update the number of upsells on WooCommerce product pages on WordPress

November 9, 2019 by admin Leave a Comment

On your WordPress website if you are using WooCommerce for ecommerce you may want to update the number of upsells listed on the product pages on there. If you want to do that without a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to it.

Update number of product upsells on product page

/**
 * Update number of upsells on product pages
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
if ( ! function_exists( 'woocommerce_output_upsells' ) ) {
	function woocommerce_output_upsells() {
	    woocommerce_upsell_display( #,# );
	}
}
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_upsells', 15 );

Then you can replace the # and # with the first # the number of products and the second # is the number of rows on there. Now if that works for you it would update the number of product upsells per row on WooCommerce product pages on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Product Page, WooCommerce

How to add the payment type to WooCommerce admin email on WordPress

November 9, 2019 by admin Leave a Comment

If you are using a WooCommerce store on your WordPress website you may want to add the payment type or method to your admin email for new orders on there. If you want to do that without a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to it.

Payment type in WooCommerce admin new order email

/**
 * Update WooCommerce payment type to email
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
function payment_type_in_admin_email( $order, $is_admin_email ) {
  if ( $is_admin_email ) {
    echo '<p><strong>Your Payment Method:</strong> ' . $order->payment_method_title . '</p>';
  }
}
add_action( 'woocommerce_email_after_order_table', 'payment_type_in_admin_email', 15, 2 );

Now if that works for you it would add the payment type to WooCommerce admin email on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Email, Functions.php, Orders, Payments, WooCommerce, WordPress Admin

How to remove the breadcrumbs from WooCommerce products on WordPress

November 7, 2019 by admin Leave a Comment

If you are using WooCommerce on your WordPress website you may want to remove the breadcrumbs from the products on there. If you want to do that without a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to the file on there.

Remove WooCommerce breadcrumbs

/**
 * Remove product breadcrumbs
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
function remove_woo_breadcrumbs() {
    remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
}
add_action( 'init', 'remove_woo_breadcrumbs' );

Now if that works for you it would remove the breadcrumbs from the WooCommerce products on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Links, Templates, WooCommerce, WordPress Admin, WordPress Theme

How to update the number of WooCommerce products on each page on WordPress

November 7, 2019 by admin Leave a Comment

On your WooCommerce store on your WordPress website you may want to update or change the number of WooCommerce products on each page of the website. If you want to do that without a plugin you can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to it.

Update how many products display on each WooCommerce page on WordPress

/**
 * Update products per page
 *
 * @author WPSnacks.com
 * @link https://www.wpsnacks.com
 */
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return #;' ), 20 );

You can then replace the # with the number of products you want per page. Now if that works for you it would update the number of WooCommerce products on each page on there.

If you like this then you should look up more of our WordPress Tips Code Snippets and Tutorials.

Disclosure: There are affiliate links on posts and throughout the website and if you use the links to make a purchase we may earn a commission from it. We link to these companies and their products because of the quality of the companies and not because of the commission we may receive from it.

Disclaimer: The information contained in this website is for general information purposes only and in no event will this website or its owners be liable for any losses or damages associated with your use of our website or content. We recommend that you make a backup of your website before you make updates to it. Click here to see our full Disclaimer.

Filed Under: Code Snippets Tagged With: Functions.php, Templates, WooCommerce, WordPress Admin, WordPress Theme

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 14
  • Go to Next Page »

Primary Sidebar

Hey, We Deliver... Anywhere!

Enter Email Address below to receive our snacks via email:

Join Over 1200 Readers!

Jump To A Random WordPress Tip

Copyright © 2019 • wpsnacks.com