Title: Conditional CSS Loading
Last modified: August 20, 2016

---

# Conditional CSS Loading

 *  Resolved [Xonox](https://wordpress.org/support/users/xonox/)
 * (@xonox)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/conditional-css-loading-1/)
 * Hi,
 * I’ve been trying a lot of ways to do this but I’m not getting it. I’m making 
   a simple widget which has an option to load a CSS file. I need to do two things:
 * 1. Load (or don’t load) CSS file according to widget setting.
 * 2. Load CSS file only when widget is used and CSS setting is true.
 * My widget has the following structure:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * I need a hand to figure out, how and where I should make it.
 * Thanks,

Viewing 1 replies (of 1 total)

 *  Thread Starter [Xonox](https://wordpress.org/support/users/xonox/)
 * (@xonox)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/conditional-css-loading-1/#post-2517236)
 * Ok…
 * Now with the code from pastebin:
    [http://pastebin.com/GkvFJLrZ](http://pastebin.com/GkvFJLrZ)
 * Any help would be appreciated.
 * Thanks.

Viewing 1 replies (of 1 total)

The topic ‘Conditional CSS Loading’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [Xonox](https://wordpress.org/support/users/xonox/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/conditional-css-loading-1/#post-2517236)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
