Bonkage.com

Handy WooCommerce Store PHP Snippets

Here are some Handy WooCommerce Store PHP Snippets that you might find useful… Auto-Complete All WooCommerce Orders 123456789101112/* Auto-Complete All WooCommerce Orders */ add_action( ‘woocommerce_thankyou’, ‘custom_woocommerce_auto_complete_order’ ); function custom_woocommerce_auto_complete_order( $order_id ) { if ( ! $order_id ) { return; } $order = wc_get_order( $order_id ); $order->update_status( ‘completed’ ); } Set Min/Max Price & Starting Price […]

The post Handy WooCommerce Store PHP Snippets appeared first on WordPress Site Handbook.

List More Custom Field Names

First install & activate the List More Custom Field Names plugin. Then add the following code to your functions.php or your custom plugin file. 12// List more custom field names add_filter( ‘c2c_list_more_custom_field_names’, create_function( ‘$limit’, ‘return 1500;’ ) ); You can change the 1500 in the example to any number you would like and that is […]

The post List More Custom Field Names appeared first on WordPress Site Handbook.

Handy PHP Snippets for WordPress Sites

Here are some very handy PHP snippets I have collected over the years… Use a shortcode inside PHP 1echo do_shortcode(‘[your_shortcode]’); Only show content to users with a specific role 12345678/* Only show content to users with a specific role */ global $user_login, $current_user; if (is_user_logged_in()) { get_currentuserinfo(); $user_info = get_userdata($current_user->ID); if (in_array(‘administrator’, $user_info->roles)) { Send […]

The post Handy PHP Snippets for WordPress Sites appeared first on WordPress Site Handbook.

Create Your Own Simple WordPress Plugin

Here I will explain how to create your own simple WordPress plugin to use on your WordPress site. I don’t normally do this because I rarely ever update a theme after I install it on a site, I usually just enter any custom PHP code into my themes functions.php file. But for those of you who […]

The post Create Your Own Simple WordPress Plugin appeared first on WordPress Site Handbook.

Add a New Custom Menu to your WordPress Theme

It is actually really easy to add a new custom menu to your WordPress theme. Just copy the following code snippet(replacing “New Menu” and “new-menu” with the name of your custom menu) into your themes functions.php file or create your own plugin using my guide on the subject. 1234567function register_my_menu() { register_nav_menu(‘new-menu’,__( ‘New Menu’ )); […]

The post Add a New Custom Menu to your WordPress Theme appeared first on WordPress Site Handbook.

How to Increase WordPress Site PageSpeed Score

Here is a quick guide to how to increase WordPress Site PageSpeed Score, to get your WordPress sites load faster and run better on mobile devices. WordPress websites generally need some work to make everything as fast as possible. I like to use GTmetrix to generate a performance report and look at their recommendations to […]

The post How to Increase WordPress Site PageSpeed Score appeared first on WordPress Site Handbook.

The Best WordPress Plugins

Here is a giant list of the best WordPress plugins in my opinion… Add Descendants As Submenu Items This plugin has saved me from the problem WordPress has with adding too many menu items. This plugin solves that issue by adding a simple checkbox to each menu item that you can check to have all […]

The post The Best WordPress Plugins appeared first on WordPress Site Handbook.