How to add custom styles to WordPress dashboard

In case you want to add some custom styles to the WP dashboard, you’ll have to enqueue a new css file in your (child-)themes functions.php: function add_admin_style() { wp_enqueue_style( ‘admin-style’, get_stylesheet_directory_uri() . ‘/css/admin-style.css’ ); } add_action(‘admin_enqueue_scripts’, ‘add_admin_style’);  

Read more

How to make a WooCommerce registration email blacklist

For whatever reason it can be useful to block specific email addresses from account registration in WooCommerce. To accomplish this you need an email blacklist. With only a few lines of code you can check if the entered email address is listed in your blacklist even before a user account is generated and echo an

Read more

How to add custom columns to WooCommerce orders table in WordPress backend

Adding custom cols to the orders table can be very useful for shop managers and admins. If you use some kind of invoice or shipping plugin, you probably don’t want to click in each order to see if there is already a shipping label or an invoice created. So what you want to do is

Read more

How to automatically add a WooCommerce product to cart on page load

WooCommerce recommends to automatically add a product to cart with a code snippet you can add to your (child-)themes functions.php: https://docs.woocommerce.com/document/automatically-add-product-to-cart-on-visit/ This code works fine and is probably everything most shop owners need. But there is a scenario where this code doesn’t work or at least isn’t a good solution. The code always adds the

Read more

How to add a simple WooCommerce product list to the WordPress dashboard

By default WooCommerce doesn’t come with an easy way to show a simple product list in the WordPress dashboard. Even though there is of course the product post type overview, there is only few information of each product you can see at first glance. If you want to see the stock or if a product

Read more

How to add your own custom Storefront footer credit

Even if you like the Storefront theme as much as I do, you probably don’t want to show everyone, that your WooCommerce store is based on that theme. So you can either simply remove the credit from the footer by adding this snippet to your (child-)themes functions.php: add_action( ‘init’, ‘tk_remove_storefront_footer_credit’, 10 ); function tk_remove_storefront_footer_credit ()

Read more

How to change WordPress excerpt length

By default WordPress excerpts are 55 characters long. If you want to make you excerpts longer or shorter, you can do this by adding this code snippet to your themes functions.php: add_filter(‘excerpt_length’, ‘tk_excerpt_length’); function tk_excerpt_length($length){ return 40; }  

Read more
Enable Notifications    OK No thanks