Add script in post

0

I'm creating a free website at link

My intention is to add codes, and for this, I would like to use highlight.js

My attempt was to add through the CDN:

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/highlight.min.js"></script>

I tried to add directly to the post but did not get results!

Would you like to know how I can uncompose these scripts in posts?

    
asked by anonymous 15.03.2017 / 03:27

1 answer

0

You can not add external scripts to WordPress.com.

To add codes, it is recommended to use the shortcode [code] .

Example:

[code language="css"]
your code here
[/code]

You can read more about this shortcode .

    
15.03.2017 / 15:42