You can ask for the activation of the theme. You can get the value of the options values templateand stylesheet. The stylesheet get the active style, a benefit if the user use an child theme. As example if ( 'my_theme' === get_option( 'stylesheet' ) ) ....
Also you can use the hooks for template and stylesheet, also s small exmaple.
add_filter( 'option_template', 'fb_theme' );
add_filter( 'option_stylesheet', 'fb_theme' );
function fb_theme( $template="" ) {
if ( 'my_theme' === $template ) {
echo 'TRUE';
}
return $template;
}
Related Posts:
- How to check if a theme is active?
- how to get path to images in the uploads folder to be used in a plugin
- How to maintain W3C standards compliance of a theme
- Difference between a theme and a plugin?
- All shortcodes not working on custom theme
- How to enable edit button in the theme’s customize UI?
- Disable plugins on cron and ajax page
- Is it good practice to remove redundant plugins and themes?
- Ship plugin with a custom theme
- Declare a function before plugin does on the theme functions.php file
- How to solve a conflict between a plugin and a theme?
- WP Config for FTP credentials
- WordPress error – PHP Fatal error: Uncaught Error: Call to undefined function register_block_type_from_metadata()
- Whats the difference between Page Builder Plugins and Theme Builder Softwares? [closed]
- How to use load_plugin_textdomain from within a theme
- Theme and Plugins sharing common libraries
- Workflow and best practice for documentation [closed]
- Is there a quick way to inject i18n domain into theme/plugin files?
- How to avoid redefining requirejs in plugin when another plugin also uses requirejs
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- Can I share predefined fonts from theme_support with a gutenberg component?
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- How can I measure the performance of any WordPress Plugin or Theme?
- add_action in functions.php, do_action in plugin?
- Implement plugins as part of a theme
- How can I list recent posts excerpts?
- Theme or Plugin: Where should I write my code?
- Plugin Deactivate Self on Activation Errors
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- Two (or more) looks, with one set of content
- Prevent WordPress installing plugins and themes via Admin
- Plugin Handle URL With Custom Theme
- How to read individual user’s directory and display content to that specific user?
- WSOD after upgrading to 3.1
- Check for security updates
- Plugin-generated pages use Not Found or Pages Archive templates?
- Is there any kind of theme on WordPress to sell my own movies?
- Is there any hook for theme activation ? or something similar?
- “No Add Button” for me to customize my WordPress with themes and pluggins
- How can I list all installed plugins/themes/versions from CLI/API?
- How to protect WordPress from security scanner [closed]
- how can I query all wordpress users of a blog
- Is it possible not to load theme on a specific page in wordpress?
- I receive taxonomy id
- Theme My Login Shortcode Doesn’t Return Anything
- Include Minit plugin in theme [closed]
- Moving FB comments at the end of page
- How to include files relative to a file’s directory
- How Do I Uninstall a Current WordPress Theme and Install a Fresh Theme
- What is it and from where it is loaded?
- Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
- Load CSS files in header of Bones theme?
- How to handle a WordPress blog with articles in different languages?
- display unique post per category
- How to display a widget on a page with no theme?
- navigation among single posts
- After a manual update, themes and plugins that were installed (and still in the directory) are not being seen
- Display WordPress comments before the plugins?
- Mobilepress fails to translate short codes
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- WordPress Cache delete on plugin uninstall
- Unknown theme modal source
- How to override any plugin file in the child theme
- Replace old theme that understand old css (vcex_icon_box css_animation)
- WordPress website will not show menu on a Mobile Device
- Mobile Menu and Mobile Sidebar missing
- Ensure WordPress Theme Uninstalls Completely
- custom fields not displaying on wordpress site
- Ajax Call not Working in Plugin
- Changing the pointing of assets from old server to new server
- Image path in childs theme
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- Securing langugae folder
- Is it possible to disable a theme programmatically?
- Google trying to index child theme files
- In the WordPress API is there a way to set the width of the post/page container
- how to add custom css at top above all css file for specific url
- How to Call Function From Separate WordPress Install on Same Server?
- What Are the Advantages of Using an mu-plugin
- Things that saved lose when logout
- Automatic updates of plugins and themes outside of wordpress.org
- What is the process for reimplementing a back up WordPress?
- Notice: Use of undefined constant Redux_TEXT_DOMAIN – assumed ‘Redux_TEXT_DOMAIN’
- Run WP inside a other Site without using frames
- Breadcrumb is not generating the correct post page url
- Display static pages instead of category, in code
- Why does theme need woocommerce to show images / content on front page?
- Install theme as part of a plugin
- Divi Template A Few Questions
- Trying to use wp_register_script/style and enqueu them from an array – getting an error [duplicate]
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- Real estate schema markup not showing up on Rich Results test
- How to create an Info Box on WordPress [closed]
- How to make content as required in custom post type?
- Any plugin installation and update overwrite current theme
- Convert from Portfolio post to WooCommerce products [closed]
- Problem on a wordpress website with a plugin [closed]
- Local WP site can’t locate plugins or theme
- Add new Plugin or Delete option Not Showing and Also Theme delete option not showing
- Error 503 Service Unavailable and wp-json/tdw/save_css