Custom HTML not displaying
-
I’m trying to add the Climate Clock listed here: https://climateclock.world/clocks#digital with the code below, but I can’t get it to show up on my site. It just shows a link: https://climateclock.world/widget-v2.js not the widget.
https://climateclock.world/widget-v2.js
WP.com: Yes
Correct account: YesThe blog I need help with is: (visible only to logged in users)
-
-
-
-
The code you can use on the wordpress.com platform is very limited, https://wordpress.com/support/code/
-
What methods have you used to try it out?
I was just able to make the clock show up on my test site by adding the Custom HTML block in Site Editor.
https://wordpress.com/support/wordpress-editor/blocks/custom-html-block/
Is that what you had tried? If not, try it out and post what happens.
-
Yes, I was using the Custom HTML block. I copy and paste the code from https://climateclock.world/clocks#digital but after saving, it automatically changes it from a script to a link!
‘https://climateclock.world/widget-v2.js<climate-clock />'<blockquote>
‘https://climateclock.world/widget-v2.js‘<blockquote>
-
SCRIPT
script src=”https://climateclock.world/widget-v2.js” async
/script
climate-clock /LINK
a href=”https://climateclock.world/widget-v2.js”
https://climateclock.world/widget-v2.js
/a -
Is it only reverting to the code/link in the editor? What happens for me is that you will see the code by default in the editor (unless you click preview on the HTML block). If you save, then load the published page, it shows the clock.
-
it shows it in the HTML block “preview” but when I go look at my published site, only the link is being displayed, not the clock. Is it because JavaScript is not allowed?
-
Looks like you’re on a free plan? Javascript only works on plugin-enabled plans, which would be the Pro Plan.
-
-
-
Hi @sanjinz
It is not possible to use javascript code on our free sites on WordPress.com for security reasons. It is possible to see the code when you add it to the editor, but we strip that code out when you attempt to publish it live to your site.
If you wish to use that code you do have the option to upgrade to our WordPress.com Pro Plan, which will move your site to our advanced hosting and allow you to use code snippets that it is not possible to use on free sites.
More info here: https://wordpress.com/pricing/
Hope that helps. Please let us know if you have any more questions.
- The topic ‘Custom HTML not displaying’ is closed to new replies.