• 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

How to insert code in Head tag

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 › How to insert code in Head tag

This topic is: resolved

Tagged: head tag, javascript, Shopify

  • This topic has 2 replies, 2 voices, and was last updated 11 years, 10 months ago by SoFlaDesigner.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 28, 2014 at 11:04 pm #87616
    SoFlaDesigner
    Member

    I am using Modern Blogger Pro and we are using the new Shopify widget that allows us to insert the products into our WordPress page. Shopify generates code that allows Javascript to insert product pages into the WordPress page.

    How do I access the Head tag of my WordPress page to insert the script for that particular web page? Thank you!

    http://jhingikaromas.com
    January 29, 2014 at 8:05 am #87657
    songdogtech
    Participant

    Use WordPress › Genesis Simple Hooks « WordPress Plugins to easily add scripts and code to the header and throughout your site and theme.

    To load a javascript on all pages, use your Shopify javascrpt file link in the wp_head Hook in Simple Hooks.

    To load one javascript on just one page, use

    <?php if (is_page('100')) { ?>
    
    <script type='text/javascript' src='http://somwehere.com/shopify.js'></script>
    
    <?php } ?>

    where "100" is the page ID or shortname.

    Or, if you want the javascript in an external file, use

    <?php if (is_page('100')) { get_template_part('shopify'); } ?>

    where the file shopify.php contains the javascript in the form of

    <script type='text/javascript'> javascript </script>

    January 29, 2014 at 5:21 pm #87746
    SoFlaDesigner
    Member

    Wow! Thank you. If I were the person maintaining this site your suggestion would make sense. But the person who will ultimately be responsible for the site, should any changes be needed, is not code savvy. I will keep your suggestion in my notes if things change and we can implement this way. Thank you!

  • 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

© 2025 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