Title: Selectively loading plugin stylesheet on posts
Last modified: August 19, 2016

---

# Selectively loading plugin stylesheet on posts

 *  [exchequer598](https://wordpress.org/support/users/exchequer598/)
 * (@exchequer598)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/selectively-loading-plugin-stylesheet-on-posts/)
 * Using the [Syntax Highlighter Compress](http://wordpress.org/extend/plugins/syntax-highlighter-compress/)
   plugin, it adds a good ~10KB worth stylesheets (not considering the JS) to all
   post pages. How do I load the stylesheets and the scripts only on the pages that
   I actually use the plugin?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Steffen Jørgensen](https://wordpress.org/support/users/jint/)
 * (@jint)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/selectively-loading-plugin-stylesheet-on-posts/#post-1786239)
 * You could ad a tag to pages that includes code to be highlighted, and do a `<?
   php if_has_tag('highlight'); ?>` to load the CSS/JS files.
 *  Thread Starter [exchequer598](https://wordpress.org/support/users/exchequer598/)
 * (@exchequer598)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/selectively-loading-plugin-stylesheet-on-posts/#post-1786325)
 * It doesn’t use the `wp_script_enqueue` or the `wp_script_dequeue` methods!
 *  Thread Starter [exchequer598](https://wordpress.org/support/users/exchequer598/)
 * (@exchequer598)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/selectively-loading-plugin-stylesheet-on-posts/#post-1786326)
 * I’m just gonna use your suggested method for the [SyntaxHighlighter Evolved](http://wordpress.org/extend/plugins/syntaxhighlighter/)
   plugin! Thanks 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Selectively loading plugin stylesheet on posts’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 3 replies
 * 2 participants
 * Last reply from: [exchequer598](https://wordpress.org/support/users/exchequer598/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/selectively-loading-plugin-stylesheet-on-posts/#post-1786326)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
