• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Adding Javascript to Widget or page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Adding Javascript to Widget or page

This topic is: not resolved

Tagged: javascript

  • This topic has 4 replies, 3 voices, and was last updated 9 years ago by bhopkins.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • February 1, 2017 at 2:35 pm #200386
    bhopkins
    Participant

    I know I've seen how to do this before, but can't seem to find the reference now. I signed up with an affiliate program that has a javascript file it needs to load. I've tried putting it in a text widget and in a page, but the data just won't load. Their images load, just not the js that displays the ads. Its pulling a javascript file from an external link. The portion of the code looks like

    <script type="text/javascript" src="https://site.com/js/somejs"></script>
    <script>
    var options = {
    container : "search_container",
    Items_per_page : 10,
    search : "social media"
    };
    search.init(options);
    </script>

    I guess I need to enqueue it, but haven't been able to find an example that pulls in a dynamic external script.

    If I can get a clue as I'm sure I'm overlooking something simple that would be great.

    Bruce

    February 1, 2017 at 3:19 pm #200393
    carasmo
    Participant

    You go to your Genesis > Admin Settings then scroll down to footer scripts and paste it in there and save. It adds to all pages.


    Genesis Theme Customization and Help

    February 2, 2017 at 8:42 am #200445
    bhopkins
    Participant

    Thanks, that not really what I want. I'll pay around with it, but I don't want it site wide as the search terms will change based on the page/post.

    February 2, 2017 at 9:22 am #200447
    Victor Font
    Moderator

    Every page has a meta box where you can add page-specific scripts.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    February 2, 2017 at 9:56 am #200450
    bhopkins
    Participant

    Thanks Victor, I had tried that at first, but for some reason with this script it just won't work. I have sort of a work around in place with an html page and an iframe, but its not optimal.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble