Custom order status background button color in WooCommerce 3.3 admin order list

You can set CSS color and background color to your custom order status displayed in admin order list this way: [php]add_action(‘admin_head’, ‘styling_admin_order_list’ ); function styling_admin_order_list() { global $pagenow, $post; if( $pagenow != ‘edit.php’) return; // Exit if( get_post_type($post->ID) != ‘shop_order’ ) return; // Exit // HERE we set your custom status $order_status = ‘Dispatched’; // … Read more

How to Resizing Image in Bootstrap Carousel

The reason why your image is resizing which is because it is fluid. You have two ways to do it: 1. Either give a fixed dimension to your image using CSS like: [css].carousel-inner > .item > img { width:640px; height:360px; }[/css] 2. A second way to can do this: [css].carousel { width:640px; height:360px; }[/css] [custom-related-posts … Read more

How to Hide Added to Cart message in WooCommerce

Update for WooCommerce 3+ The hook wc_add_to_cart_message is deprecated and replaced by wc_add_to_cart_message_html. You can use the following (compact effective way): [php]add_filter( ‘wc_add_to_cart_message_html’, ‘__return_false’ );[/php] Or the normal way: [php]add_filter( ‘wc_add_to_cart_message_html’, ’empty_wc_add_to_cart_message’); function empty_wc_add_to_cart_message( $message, $products ) { return ”; }; [/php] Before WooCommerce 3, use this: Removing only the message (pasting it to your function.php file inside … Read more

How to add a simple jQuery script to WordPress?

First you need to write your script. In your theme folder create a folder called something like ‘js’. Create a file in that folder for your javascript. E.g. your-script.js. Add your jQuery script to that file (you don’t need <script> tags in a .js file). Here is an example of how your jQuery script (in wp-content/themes/your-theme/js/your-scrript.js) might … Read more

TypeError: ‘undefined’ is not a function (evaluating ‘$(document)’)

WordPress uses jQuery in noConflict mode by default. You need to reference it using jQuery as the variable name, not $, e.g. use [sourcecode language=”plain”]jQuery(document);[/sourcecode] [custom-related-posts title=”You may Also Like:” none_text=”None found” order_by=”title” order=”ASC”]

In WordPress How to Use jquery and $ Sign

By default when you enqueue jQuery in WordPress you must use jQuery, and $ is not used (this is for compatibility with other libraries). Your solution of wrapping it in function will work fine, or you can load jQuery some other way (but that’s probably not a good idea in WordPress). If you must use document.ready, you can actually pass $ into … Read more