• We’re looking for a way to add a small JavaScript code to a text widget without having to add a plugin. Any ideas?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Is this a link to javascript on an external site?

    Thread Starter WebDev22

    (@webdev22)

    Yes. It’s a link to a JavaScript from our lead-generation marketing program. The script displays a sentence and a call-to-action button, which is all administered within the lead-gen admin.

    Have you tried simply adding it as a link to the Text widget?

    Thread Starter WebDev22

    (@webdev22)

    I just tried wrapping it in anchors, but it didn’t render the link. Is that what you meant trying?

    Yes. What does the LG program say to do with this javascript?

    Thread Starter WebDev22

    (@webdev22)

    They don’t have any suggestions.

    Can you post the code you have been given here?

    Thread Starter WebDev22

    (@webdev22)

    That works just fine for me when added to a Text widget “as is”.

    Thread Starter WebDev22

    (@webdev22)

    We’re not able to do this from an actual page. I’m trying to get it to work under the Text Widget section (Text Box 1) at the bottom of the admin screen for that page. I haven’t tried it from Widgets, but Widgets wouldn’t work because we only need it for one page. Is that where you tried it?

    There will be a series of unique scripts for several different pages, with several different calls to action.

    I’m trying to get it to work under the Text Widget section (Text Box 1) at the bottom of the admin screen for that page.

    Whatever that is, it’s not part of WordPress itself. I can only guess that it’s being added by your theme or a plugin. so if you want it work work via that box, you’ll need to fire off a post to the relevant theme or plugin developer.

    If you want to have a go at using widgets, You could try installing http://ww.wp.xz.cn/extend/plugins/widget-logic/ Pretty sure it allows you to control widget display right down to the single page level

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

The topic ‘How to enable JavaScript in a text widget without a plugin’ is closed to new replies.