Title: HTML,JS,CSS as a shortcode
Last modified: January 21, 2022

---

# HTML,JS,CSS as a shortcode

 *  Resolved [zzlatevv](https://wordpress.org/support/users/zzlatevv/)
 * (@zzlatevv)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/htmljscss-as-a-shortcode/)
 * Hey there, I have HTML, JS and CSS for Google Maps and I’m looking to create 
   a shortcode with these files/code. Is it possible?

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

 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/htmljscss-as-a-shortcode/#post-15277909)
 * Hi [@zzlatevv](https://wordpress.org/support/users/zzlatevv/),
 * Yes, it is definitely possible. You can create a shortcode with all the HTML,
   CSS and JS code.
 * If you have those as separate files, then you can upload them to your site and
   use the respective syntax to import those files like here – [https://betterprogramming.pub/link-css-and-js-files-with-html-file-f848d00b42e8](https://betterprogramming.pub/link-css-and-js-files-with-html-file-f848d00b42e8)
 * Thanks,
    Aakash
 *  Thread Starter [zzlatevv](https://wordpress.org/support/users/zzlatevv/)
 * (@zzlatevv)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/htmljscss-as-a-shortcode/#post-15279806)
 * Hi [@vaakash](https://wordpress.org/support/users/vaakash/), can you please help
   me to create a shortcode with all the HTML, CSS, and JS code? Do you mean I have
   to link the CSS and JS files into the HTML code, and that would be enough? Do
   I only have to add the HTML content as content to create the shortcode?
 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/htmljscss-as-a-shortcode/#post-15279840)
 * Hi [@zzlatevv](https://wordpress.org/support/users/zzlatevv/),
 * Yes, you can copy paste the HTML, CSS and JS inside the shortcode content in 
   the editor.
 * Linking the files are optional. You can link if the CSS, JS are present as separate
   files (i.e css or .js)
 * If you have free flowing code, then you can follow this link to paste them inline–
   [https://www.keycdn.com/support/inline-small-css-and-javascript](https://www.keycdn.com/support/inline-small-css-and-javascript)
 * After pasting the content, just save the shortcode. Now you can use the shortcode
   anywhere in your posts and pages. Whatever code you have pasted will be available
   whereever the shortcode is used.
 * Please share more details or screenshot if I’m not clear or if I misunderstood
   your query.
 * Thanks,
    Aakash
 *  Thread Starter [zzlatevv](https://wordpress.org/support/users/zzlatevv/)
 * (@zzlatevv)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/htmljscss-as-a-shortcode/#post-15279857)
 * Thank you so much for your reply, Aakash! Yes, that’s exactly what I’m looking
   for, but it doesn’t work on my end after adding the code of the 3 files inside
   the shortcode content.
    I will try to link the files into HTML and get back to
   you.
 * I’m trying to create a Google Map if this matters. Here are the files:
    [https://developers.google.com/maps/documentation/javascript/custom-markers#maps_custom_markers-javascript](https://developers.google.com/maps/documentation/javascript/custom-markers#maps_custom_markers-javascript)
 *  Plugin Author [vaakash](https://wordpress.org/support/users/vaakash/)
 * (@vaakash)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/htmljscss-as-a-shortcode/#post-15279976)
 * Hi [@zzlatevv](https://wordpress.org/support/users/zzlatevv/),
 * So the google map needs CSS, JS and HTML.
 * You can wrap the “CSS” with the “style” tag and JS with the “script” tag. Then
   paste HTML as is. Follow the link in my previous reply for more details on that.
 * For this specific Google maps use case, I would suggest just copy paste the code
   as is without linking.
 * Thanks,
    Aakash
 *  Thread Starter [zzlatevv](https://wordpress.org/support/users/zzlatevv/)
 * (@zzlatevv)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/htmljscss-as-a-shortcode/#post-15280987)
 * Hey again [@vaakash](https://wordpress.org/support/users/vaakash/),
 * > For this specific Google maps use case, I would suggest just copy paste the
   > code as is without linking.
 * Do you mean that I have to copy-paste the whole code as-is from the files(HTML,
   CSS, and JS)?
 * Is it possible to send you the files so you can check if it works? It doesn’t
   work on my end, unfortunately.

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

The topic ‘HTML,JS,CSS as a shortcode’ is closed to new replies.

 * ![](https://ps.w.org/shortcoder/assets/icon.svg?rev=2222236)
 * [Shortcoder — Create Shortcodes for Anything](https://wordpress.org/plugins/shortcoder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcoder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcoder/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcoder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcoder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcoder/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [zzlatevv](https://wordpress.org/support/users/zzlatevv/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/htmljscss-as-a-shortcode/#post-15280987)
 * Status: resolved