Code to Enable Shortcodes on Widgets in WordPress- Add the following code snippet to your theme’s functions.php file:-
Category: WordPress
Webp upload wordpress- If you want to save the storage space on your server, using the WebP format every time you want to upload an image is a reasonable reason. An image with the extension of .webp is 25% smaller in size than other formats like JPG and PNG. Add the following code to the
Code to Add text before and after add to cart button in WooCommerce-
Code to Disable Post Revisions in WordPress- You can add the following line of code to your wp-config.php file:-
Code to Disable Admin Bar Access in WordPress- If you want to disable access to the admin bar for all the users including the administrator, add the following to your theme’s functions.php file:-
Code to Restrict Bots Access in WordPress Add the following code to .htaccess file.
Code to Show the Number of Search Results Found in WordPress- Display the number of search results found in your WordPress search results page by adding the following line of code to your theme’s search.php file-
This will list all the top level categories and subcategories under them hierarchically. do not use the inner query if you just want to display the top level categories. Style it as you like.
Code to Prevent Image Hotlinking in WordPress- Go to .htaccess file and add the following code. Make sure you replace the ‘your-domain-name-here’ part with your actual domain name-