Home › Forums › Weaver Xtreme Theme › Adding a Javascript to Widget?
- This topic has 7 replies, 3 voices, and was last updated 11 years, 5 months ago by
MarkieMadden.
-
AuthorPosts
-
April 4, 2015 at 01:01 UTC - Views: 2 #17558
MarkieMadden
ParticipantHello there. I’m trying unsuccessfully to add an Amazon.uk Affiliate widget to my WordPress-powered site hosted through Bluehost. I’m using Weaver Xtreme theme and I love it. But even though I copy and paste the code from Amazon, it doesn’t show up in the widget area. The code begins with <script and then type=text/javascript so I assume it’s Java and not regular html. Why is is not showing up? Is there something I need to do in my theme in order to show Java?
April 4, 2015 at 01:18 UTC - Views: 1 #21051scrambler
ModeratorWithout knowing what you are pasting it is hard to know.
You can first try in in a test page based on the default template, paste the whole code as provided in the content editor while in TEXT mode, and make sure to check the options “Allow Raw HTML and script” in the page options.
If it is a script, it will be inside script tags like
<script type=text/javascript>The content of the script </script>
Which is the valid HTML syntax to insert a script
April 4, 2015 at 23:37 UTC #21052MarkieMadden
ParticipantThank you Scrambler. I tried that, and it worked…once. Now it’s not at all except the widget title. Here’s part of the code I’m trying to insert. I took out the part that I thought was sensitive information and I didn’t know how it will show in the post anyway.
<SCRIPT charset=”utf-8″ type=”text/javascript” src=”http://ws-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&MarketPlace Operation=NoScript”>Amazon.co.uk Widgets</A></NOSCRIPT>April 4, 2015 at 23:53 UTC #21053scrambler
ModeratorYour syntax appears to be wrong, you have a closing link tag (</a>) without an open one.
Anyway, if it is not working, either the code syntax is wrong or the script is not working, and in both cases, you need to verify the code you are using with its provider
April 5, 2015 at 00:28 UTC #21054MarkieMadden
ParticipantWell, as I said, that wasn’t the whole code, I took out some of the middle.
BUT, I can get it to work in a widget (for some reason it’s working now), however, that kills my https security on the site. I tried changing the Amazon links in <a href= to both read https instead of http, but it still doesn’t bump up my security. Any ideas?April 5, 2015 at 23:24 UTC #21055Weaver
KeymasterAn easy and safe way to deal with http:// vs https:// is to simply use // only. E.g., href=”https://example.com” can be expressed as href=”//example.com”
April 6, 2015 at 00:40 UTC #21056MarkieMadden
ParticipantWeaver, interesting. I think I might have to give that a try. I’d love to be able to include my Amazon affiliate codes. I’ve not made anything off of them as of yet but they’ve only been posted on my old Blogger, which I’m no longer using. But I certainly won’t make anything if I don’t post them!
April 6, 2015 at 00:49 UTC - Views: 1 #21057MarkieMadden
ParticipantStill not working right. There’s only two links in this JavaScript: one is a src= link, the other is an a href. I haven’t studied Java yet but it’s next in my list. I’ve also alerted Amazon to this so I’m interested to see what they say.
-
AuthorPosts
- You must be logged in to reply to this topic.

