X

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.

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

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!