Pawan Kumawat

Disable plugin update in WordPress

While it’s generally not recommended to disable plugin updates in WordPress due to security and functionality improvements, there might be specific cases where you need to prevent certain plugins from updating. Keep in mind that doing so may leave your site vulnerable to security issues and may cause compatibility problems with future WordPress versions.

Display a Product Category Dropdown and Redirect To Single Category Upon Selection.

How To add category dropdown Before WooCommerce product loop? WooCommerce product loop is generally on shop page and category page. on both pages WooCommerce provide hooks before the loop and after the loop. “woocommerce_before_shop_loop” “woocommerce_after_shop_loop” For adding a category dropdpwn or other texonomy dropdown We will use “woocommerce_before_shop_loop”.   For Both Product loop. (shop page and category page) function CategorySwitcher() { wc_product_dropdown_categories(); $category_base=get_option(‘woocommerce_permalinks’)[‘category_base’]; wc_enqueue_js( ” (‘#product_cat’).change(function () { location.href = ‘”.site_url().’/’.$category_base.”/’ + $(this).val(); }); “); } add_action(‘woocommerce_before_shop_loop’,’CategorySwitcher’,100); For Only Category Archive Page.   function CategorySwitcher() { if ( is_product_category() ) { wc_product_dropdown_categories(); } $category_base=get_option(‘woocommerce_permalinks’)[‘category_base’]; wc_enqueue_js( ” (‘#product_cat’).change(function () { location.href = ‘”.site_url().’/’.$category_base.”/’ + $(this).val(); }); “); } add_action(‘woocommerce_before_shop_loop’,’CategorySwitcher’,100); For Only Shop Page.   function CategorySwitcher() { if ( is_shop() ) { wc_product_dropdown_categories(); } $category_base=get_option(‘woocommerce_permalinks’)[‘category_base’]; wc_enqueue_js( ” (‘#product_cat’).change(function () { location.href = ‘”.site_url().’/’.$category_base.”/’ + $(this).val(); }); “); } add_action(‘woocommerce_before_shop_loop’,’CategorySwitcher’,100);  

Disable Automatic Login After Registration

When we enable customer registration on My Account page, We will know that when new user is register it’s automatically logged in .
it need to change when we need to manually approve each user.

Remove Welcome Panel from WordPress

In WordPress, the “Welcome” panel is a dashboard widget that appears for new users or users who haven’t dismissed it yet. It provides some basic information and links to help users get started with WordPress. If you want to remove the “Welcome” panel from the WordPress dashboard, you can do so using either a plugin or custom code. Option 1: Remove “Welcome” Panel Using a Plugin 1. Install and activate the “Disable Welcome Panel” plugin. You can find this plugin on the WordPress.org plugin repository. 2. Once activated, the “Welcome” panel will no longer be displayed on the WordPress dashboard. Option 2: Remove “Welcome” Panel Using Custom Code If you prefer to remove the “Welcome” panel using custom code, follow these steps: 1. Open your theme’s `functions.php` file or create a custom plugin file. 2. Add the following code to remove the “Welcome” panel:   function custom_remove_welcome_panel() { remove_action(‘welcome_panel’, ‘wp_welcome_panel’);

Categories