Title: HTML/CSS/Javascript Support?
Last modified: May 23, 2017

---

# HTML/CSS/Javascript Support?

 *  Resolved [rafieek](https://wordpress.org/support/users/rafieek/)
 * (@rafieek)
 * [9 years ago](https://wordpress.org/support/topic/htmlcssjavascript-support/)
 * Can Code Snippets include HTML, CSS, and Javascript in addition to PHP?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/htmlcssjavascript-support/#post-9478040)
 * It sure can! You will still need to add the snippets as PHP snippets, with a 
   wrapper function around the CSS, HTML or JavaScript code.
 * **HTML example (using a shortcode):**
 *     ```
       add_shortcode( 'my_content', funcition () { ?>
   
       <p>Insert your HTML code here!</p>
   
       <?php } );
       ```
   
 * **CSS example:**
 *     ```
       add_action( 'wp_head', function () { ?>	
       <style>
   
       /* CSS code goes here */
   
       body {
           background-color: midnightblue;
       }
   
       </style>
       <?php } );
       ```
   
 * **JavaScript example:**
 *     ```
       add_action( 'wp_head', function () { ?>	
       <script>
   
       /* JavaScript code goes here */
   
       alert('hello!');
   
       </script>
       <?php } );
       ```
   
 * I would like to add better support for adding different sorts of snippets in 
   a future version of the plugin, but for now these wrapper functions are a good
   alternative.

Viewing 1 replies (of 1 total)

The topic ‘HTML/CSS/Javascript Support?’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/htmlcssjavascript-support/#post-9478040)
 * Status: resolved