• 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

Trying to add some js to genesis

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 › Trying to add some js to genesis

This topic is: not resolved
  • This topic has 3 replies, 3 voices, and was last updated 12 years, 11 months ago by Brad Dalton.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 7, 2013 at 3:11 am #49607
    ᴅᴀᴠɪᴅ
    Member

    I've bought a plugin but unfortunately it is not a 'straight out the box' wordpress plugin and needs me to manually apply it. (My first time). I am a fast learner and don't mind breaking my site a few times in the learning process either. My question is this..

    The person who wrote the plugin has told me I can upload the js files into the theme folder and then "use the functions.php file to embed the js and css files relative related". Its the second bit i am confused with. Do I really need to use the functions.php file? I have read codex etc and it tells me that the code you put into functions.php is only for adding code such as

    <script type='text/javascript' src='http://yourdomain.com/wp-content/plugins/yourplugin/js/custom-script.js?ver=3.3.1'></script>

    into my wp_head():

    With Genesis i can do this from my dashboard, so do I really need to mess around with the functions.php file? Or is this always necessary when adding some js to any wordpress site?

    I am trying to keep the question non-specific to this one plugin so you can help. I'm sure the process of adding any js to genesis is the same, it is just not one i am familiar with.


    I love helping creative entrepreneurs build epic things with WP & Genesis.

    Follow on Twitter

    July 7, 2013 at 3:13 am #49608
    ᴅᴀᴠɪᴅ
    Member

    just to clarify (i tend to waffle)

    I am asking if to add javascript to my genesis site, for the purpose of installing a plugin, can i insert code such as

    <script type='text/javascript' src='http://yourdomain.com/wp-content/plugins/yourplugin/js/custom-script.js?ver=3.3.1'></script>

    into my wp_head(): through the dashboard, or do i need to insert it somehow using functions.php.

    Note: I only actually need the js to load on one specific page of my site, if that changes anything.


    I love helping creative entrepreneurs build epic things with WP & Genesis.

    Follow on Twitter

    July 7, 2013 at 4:54 am #49612
    Stewart
    Member

    Hi Dave,

    You could insert it through the dashboard, but I advise against it for the reason that it will load on every page, thus adding unnecessary javascript for most of your site.

    The way I would suggest loading it is via your functions file using a conditional tag() to only load on the specfic page you want to use your plugin on.

    Hope this helps
    Stewart


    WordPress Developer – Need help upgrading to Genesis 2.0? – My Blog
    Follow me on Twitter

    July 7, 2013 at 5:55 am #49618
    Brad Dalton
    Participant

    Use the Scripts box below each edit page/post screen or hook it in using a custom function with conditional tag:

    You'll need to save the script as a .js file and place it in a new folder in your child themes directory named js or change the path to the file in the code.

    Also, use the page-slug or post/page i.d in the conditional statement.


    Tutorials for StudioPress Themes.

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