Conditional Loading of BBPress Stylesheet
-
I have a multi-site installation of WordPress. I have created a local bbpress stylesheet in my theme that I want to load ONLY if the site administrator has activated the bbpress plugin. I am unclear on the conditional statement (e.g., “if(function_exists..”) to accomplish this as I do with other plugins that are optional. I have tried the following in my functions.php file but it throws an error. Please advise:
<?php //Load the bbpress styles if bbpress is installed // if (class_exists( 'bbPress' ) ) { ?> <link rel="stylesheet" id="bbpress_style" href="<?php echo get_stylesheet_directory_uri(); ?>/bbpress.css" type="text/css" media="screen" /> <? } ?>
Any input would be appreciated. Thank you!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.