RE [wp-hackers] loading css only on page where plugin is used

Michael Toppa public at toppa.com
Wed Apr 22 12:48:59 GMT 2009


Thanks for the reply Ozh - inline styling could work but would be really 
ugly, as my plugin involves a fairly heavily styled form that uses an 
ordered list for organizing the form elements. It would also mean users 
would have to hack my code if they wanted to customize the display (I 
suppose I could put in placeholder class declarations too, but then 
we're getting into a workaround on top of a workaround). Mike T Date: 
Wed, 22 Apr 2009 13:50:00 +0200 From: "Ozh" <ozh at planetozh.com> Subject: 
RE [wp-hackers] loading css only on page where plugin is used To: 
wp-hackers at lists.automattic.com Message-ID: 
<OF6660D081.F3C53FEC-ONC12575A0.0040D66D-C12575A0.0041012B at notes.edfgdf.fr> 
Content-Type: text/plain; charset="ISO-8859-1" 
wp-hackers-bounces at lists.automattic.com a écrit sur 22/04/2009 13:38:04 :

> > Hi all,
> > 
> > I'm working on a plugin that uses a shortcode. I want to load a css file 
>   
> > for the plugin only for posts or pages that use the shortcode.
>   

If you want to load the style only on some pages, maybe you can add it 
inline? If so, testing the presence of the shortcode in each post is easy 
(and you can also make it so it loads once in case multiple posts are 
displayed)

Ozh



More information about the wp-hackers mailing list