Title: Adding CSS to a shortcode plugin
Last modified: August 21, 2016

---

# Adding CSS to a shortcode plugin

 *  [Double_D](https://wordpress.org/support/users/double_d/)
 * (@double_d)
 * [13 years ago](https://wordpress.org/support/topic/adding-css-to-a-shortcode-plugin/)
 * I’m working on developing some plugins for a wordpress site. and I would like
   to have my css code stored in a separate css file in the plugin folder. what 
   do i need to add to tell it to look for css style info in my css file (say mystyle.
   css” ? My current code is;
 *     ```
       //define plugin defaults
       DEFINE("DDCOLLAPSABLE_HEADER", "Header Title");
   
       //tell wordpress to register the dd_collapsable shortcode
       add_shortcode("dd_collapsable", "ddcollapsable_handler");
   
       function ddcollapsable_handler($incomingfrompost) {
         $incomingfrompost=shortcode_atts(array(
           "headertitle" => DDCOLLAPSABLE_HEADER
         ), $incomingfrompost);
   
         //run function that actually does the work of the plugin
         $ddcollapsable_handler_output = ddcollapsable_function($incomingfrompost);
         //send back text to replace shortcode in post
         return $ddcollapsable_handler_output;
       }
   
       function ddcollapsable_function($incomingfromhandler) {
         //process plugin
         $ddcollapsable_output = "<div class='box effect8'>";
         $ddcollapsable_output .= wp_specialchars_decode($incomingfromhandler["headertitle"]);
         $ddcollapsable_output .= "<br>";
         $ddcollapsable_output .= "Hello World!";
         $ddcollapsable_output .= "</div>";
         //send back text to calling function
         return $ddcollapsable_output;
       }
       ?>
       ```
   

The topic ‘Adding CSS to a shortcode plugin’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Double_D](https://wordpress.org/support/users/double_d/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/adding-css-to-a-shortcode-plugin/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
