How to Use WordPress "Theme Specific" Conditional Statements

How to Use WordPress “Theme Specific” Conditional Statements

This snippet can be used to target code for a specific theme only. A need feature if you want to execute conditional functions on ex. different devices and platforms.

Add this to your functions.php file.

if (get_current_theme() == 'Theme Name') {
     echo '# code...';

WordPress Hosting

Leave a Reply

Your email address will not be published. Required fields are marked *