Load stylesheets only if a plugin is active in a page
-
Hello all,
could you please help me with this little problem i have?my stylesheet is large, and i would like to split into smaller stylesheets, which load only when necessary.
for example, i`d like to load the contact form styles only if the cformsII plugin is active AND a cformsII form is present in this particular page. on any other page, the stylesheet should not load.
i`m using a similar technique to load scripts only if a shortcode is running in the current page/post:
if(has_shortcode('tabs')) { wp_enqueue_script( 'jQueryIDtabs' ); }
thanks in advance!
andi
- The topic ‘Load stylesheets only if a plugin is active in a page’ is closed to new replies.