A WordPress Blog Specific Plugin is a site specific plugin, used to host theme independent code snippets.
You can use these snippets to add, modify, remove, and extent WordPress as well as non WordPress features.
Adding custom code snippets in your theme’s functions.php file is not a Good Habit. Discontinue immediately.
Instead place the code in WordPress Theme Independent Plugin.
Benefits of WordPress Blog Specific Plugin
- To have a permanent place for all theme independent code.
- To preserve settings even after theme upgrades.
- To quickly change theme without losing any modifications.
- To avoid WordPress white screen of death or errors.
- Easy to maintain.
- Useful and handy when you change your hosting provider.
Steps To Create WordPress Blog Specific Plugin
- Create a new folder in the plugin directory named “WordPress Blog Specific Plugin”. /wp-content/plugins/wordpress-blog-specific-plugin/
- Then create a new file in this folder and save it as “wbsp.php”.
- Open this file and copy paste below code.
- On WordPress dashboard select Installed Plugins in Plugins menu and activate WordPress Blog Specific Plugin.
<?php
/*
Plugin Name: WordPress Blog Specific Plugin
Plugin URI: https://kunaldesai.blog/create-wordpress-blog-specific-plugin/
Description: Place for all theme independent WordPress code snippets.
Author: Kunal A. Desai
Author URI: https://kunaldesai.blog
License: GNU General Public License v2.0 (or later)
License URI: https://www.opensource.org/licenses/gpl-license.php
This plugin comes WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
// Prevent direct file access to this php file
defined( 'ABSPATH' ) or die( 'Direct file access disabled by kunaldesai.blog' );
/* Add Code Snippets Below this Line */
/* Don't Add Code Snippets Below this Line */
Moral of the story
Make a habit to place all theme independent code snippets in your newly WordPress Blog Specific Plugin.
Share the Love
NSE Indices
BSE Indices
US Indices
Global Indices
US Stocks
Popular Blogs
Trending Blogs
- 10 Ways Practicing Gratitude Can Transform Your Life
- Top 34 Inspiring Examples of Good Karma to Improve Your Life
- The Art of Giving: A Guide to Meaningful Donations
- 40 Real-Life Instances of Irresponsible Behavior
- 32 Examples of Individual Rights You Didn’t Know You Had
- How to Change Your WordPress Author Slug and Base