Using a Shortcode to Replace Themes Stylesheet?

Is there a function to replace the active theme’s stylesheet with a different one (not just adding a new one, but actually replacing the current one)?

I’m developing a plugin, and using shortcodes (eg: [design style=”dark”]) and I want this shortcode to remove the current stylesheet and apply a new one, along with new HTML for the page as well.

Read More

In fact, I want this shortcode to completely replace all of the source code for that specific post.

Can anybody point me in the right direction? Thanks in advance.

Related posts

Leave a Reply

3 comments

  1. Main stylesheet of theme is surprisingly rigid concept. It is usually semi-hardcoded in header.php before any meaningful hooks and is very hard to change by code and reliably.

    Since your context is actually wider and includes markup as well, you are better of hijacking template entirely, see template_redirect action for starters.