Use get_stylesheet()
to get the directory name of the theme being used. If a child theme is being used you can determine the parent with get_template()
.
At the top of the plugin file you can simply return
early if the value is not what you want.
if ( 'my-theme' !== get_stylesheet() ) {
return;
}
Related Posts:
- WordPress plugin from own server
- How to avoid plugin name conflicts from the upgrade notifier?
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- Customizing subject in comment notification e-mails
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- Add content to /wp-admin/plugin-install.php admin screens
- How do I only load a plugin js on it’s settings pages?
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- Activate Plugin which is in subfolder?
- Use functionality of 2 wordpress plugins
- Plugin child folder?
- Autoload via composer in plugin interference
- merging an array to an existing array using add_filter
- Can WordPress plugins “Talk to each other”?
- How do I store information in a dynamic block in WordPress?
- Is it possible to set up multistore in Woocommerce? [closed]
- How to create custom embed block in gutenberg wordpress
- Plugin exceeds memory limit
- Find the URL of the current plugin directory
- How can sanitize $_FILES[‘haq_slider’] field
- Plugin Paths Issue
- How to generate video out of images via WordPress plugin
- Woocommerce plugin for minimum order and add-to-card-step
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- How to slice an array using posts_per_page? [closed]
- Get plugin option in another PHP file
- How to apply a patch via plugin?
- woocommerce payment gateway callback not firing [closed]
- White page by using filter template_include
- How to export post 2 posts WordPress plugin data [closed]
- Customization API for plugin development
- User switching only with specific role and return
- Adding Font Awesome to WP Plugin
- Unable to delete custom post types, confusion around capabilities
- Getting wp.me shortlink for wordpress custom post type
- Display custom content using page.php from theme
- where is the main file in this plugin?
- Remove .htaccess portion upon plugin deactivation?
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- First plugin, problem with get_pages
- Translations for my plugin don’t show up
- Plugin onclick button activate other plugin
- Translation issue with global variables
- Is there a better way of handling AJAX requests in WordPress?
- how to add a comment button to be displayed only for the posts in the home page [closed]
- what is the point of telling add_filter how many parameters you want passed to the function?
- How to add category and subcategory in WordPress custom code?
- Structuring function with registration_errors hook
- Can’t create tables with my plugin
- using wp_cache in plugin
- Should I use the action in the plugin’s main file?
- How to data add to table when update post wordpress? when we clicked!
- can’t unzip file
- WooCommerce – I want to add functionality of one plugin to another plugin — best approach?
- wp_query ‘s’ parameter does not work with WC_AJAX
- Monitor all the queriers executed by my website
- Dotenv file in custom plugin
- Check if theme supports sidebar
- Problem with MEMCACHE and Redis with wp_options
- Change plugin descriptions
- Getting the same post on my related post
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- How to create a page with the selected template after activating the plugin
- How to remove WordPress Default Comment? not Facebook
- How to use Datatable with Ajax when creating plugin on WordPress?
- I enabled debugging but I still get the same message: There has been a critical error on your website
- wp_mail function not working in WordPress Plugin Boilerplate
- When/where would want to attach other classes to the base class in a WordPress plugin?
- Create survey that redirects to sidebar menu customized to answers
- Use Case: Multiple Shipping Methods per Order
- Showing how many times is plugin activated or deactivated
- Changing author slug for a custom role without using plugin
- plugin operation launch every time i click on page
- Could someone maybe point me in the direction of a decent tutorial on how to create a wordpress plugin that is compatible with another plugin please?
- Custom plugin which downloads updates from custom endpoint, extracts new version zip into a new name
- WP options plugin setting not saving the selected checkboxes
- How can I customize Easy Appointment plugin?
- How to get post that has non zero or greater than zero meta value
- how to add custom css at top above all css file for specific url
- Form tries to download a file on submit
- Coming soon pages with rest of site in maintenance mode
- insert multiple entries in database using a loop issue
- Web Application Framework Compatibility with WP Plugin
- Plugin Works, but Widget Doesn’t
- Plugin loaded, but not running
- Merge custom plugins in one folder
- Execute certain function on GET request
- Multiselect value in wp_query
- Filter EVERY category link with my plugin
- how to load a file from a plugin when a url is passed
- Is it possible to cancel a post status transition?
- Undefined variable _POST
- How to include a custom thumbnail with my WordPress plugin?
- How to create a nameplate extension? [closed]
- ACF Plugin WP with list-group – Vimeo [closed]
- Meta box not displaying on the plugin page
- Why am I getting an error when requiring a file in my plugin?
- public custom posts not showing in my wordpress plugin
- Allow manage_options capability for specific user only for specific plugin?