Theme Specific Conditional

This can be used for code for a specific theme only. I had to use something similar to this when developing a site that used a mobile theme switch for a plugin I only wanted on the desktop site and not on the mobile site.

Note: Can only be used in conjunction with “theme switching plugins” if the desired “theme specific plugin” comes AFTER the “theme switch plugin” in order of execution.

Code Snippet:

<?php
	if (get_current_theme() == 'Theme Name') {
		echo '# code...';
	}
?>

Posted in Conditional