[wp-hackers] Selective CSS based on Shortcode?

Otto otto at ottodestruct.com
Wed Jan 27 19:58:29 UTC 2010

Sounds to me like you're going about it the wrong way in the first
place. The whole idea behind CSS is that it is overridable to begin
with. You shouldn't need to detect the shortcode and include extra CSS
based on it.

Why can't you make your plugin create an appropriate class surrounding
its output, then make your CSS act accordingly?

Sent from Memphis, TN, United States

On Wed, Jan 27, 2010 at 2:32 AM, Matthew Kettlewell <ceo at kettlewell.net> wrote:
> I'm wanting to override CSS in posts that use a shortcode from my
> plugin....
> problem is that I'm not sure how to go about doing this...
> I'm using add_shortcode() to check in the post contents for the shortcode,
> but I'm needing to know if the shortcode is used when I'in in header.php.
> I've tried setting meta_data in my function that is called from
> add_shortcode(), but it's too late...
> Is there a way to get the shortcode value before header.php is called?
> Thanks
> Matt
> --
> Matthew Kettlewell
> http://www.TazaTek.com
> http://www.twitter.com/kettlewell
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list