• 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

Custom JS script not loading Genesis Divine Theme

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 › Custom JS script not loading Genesis Divine Theme

This topic is: resolved

Tagged: Divine theme, genesis, javascript, zopim

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 6 months ago by plentyvegan.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 24, 2016 at 3:19 pm #191978
    plentyvegan
    Member

    I uninstalled the Zopim customer chat widget because it was slowing down my site.

    I want to install the following code instead to activate the Zopim chat:

    <script src="//v2.zopim.com/?3stzWaCrOSL8e0lTgIrLZD7J8D1lxmR2" charset="utf-8" type="text/javascript"></script>

    Zopim instructs to install it before the </body> tag in the footer.php, footer.tpl, index.php, or index.tpl files.

    The Divine theme doesn't have these and you're not supposed to edit the parent Genesis theme.

    I instead created a .js file with the script in it and saved it to the js folder in the Divine theme.

    I added the following to the functions.php file in Divine to "activate" that script:

    //* Add Zopim
    function custom_scripts() {
    // Loads theme JavaScript file.
    wp_enqueue_script('customjs', get_template_directory_uri() . '/js/zopim.js', false );
    }
    add_action('wp_enqueue_scripts', 'custom_scripts');

    Nothing happened.

    I followed these instructions: https://wordpress.org/support/topic/how-to-add-plugin-code-to-header-html-using-function

    Thoughts?

    http://plentyvegan.com/
    August 24, 2016 at 3:27 pm #191979
    Victor Font
    Moderator

    You could have just added the script link to the header or footer from Genesis/Settings/ Header and Footer Scripts.

    By the way, the get_template_directory_uri() function you are using to retrieve the file location is looking in the Genesis directory, not the child theme directory. If you view the source code of your page, you can see where you loaded the script incorrectly. For a child theme, you should use get_bloginfo( 'stylesheet_directory' ) instead of the function you are using.


    Regards,

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

    August 24, 2016 at 3:36 pm #191981
    plentyvegan
    Member

    I totally forgot about that section of the admin - added the script and it worked.

    I also had the thought that I was directing it to the parent theme - should have explored that more. Thanks for the info again!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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