• 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

Place Script in Header PHP

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 › Design Tips and Tricks › Place Script in Header PHP

This topic is: not resolved

Tagged: facetwp, header.php

  • This topic has 8 replies, 4 voices, and was last updated 10 years, 8 months ago by BlogDaz.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • February 20, 2015 at 12:51 am #141414
    BlogDaz
    Participant

    I'm using FacetWP, I recently opened a support ticket with FacetWP to ask where I can place a piece of javascript code which will prevent facets refreshing. I was advised to place the code in the themes header.php right after "<?php wp_header(); ?> " . The problem is my theme Eleven40 Pro does not have a header.php file, we are advised against editing the Genesis Framework files, and anyway the Genesis header.php does not contain the above line of code. So where can I place the javascript ?.
    Best regards..Darren

    http://www.pattayahotelrooms.com/
    February 20, 2015 at 7:17 am #141441
    coralseait
    Member

    Howdy,

    You'll want to use an appropriate action hook, which you can find here: http://my.studiopress.com/docs/hook-reference/


    Coral Sea IT

    February 21, 2015 at 12:21 am #141606
    BlogDaz
    Participant

    Thanks for pointing me in the right direction coralseait, but so many action hooks, which one, and what to do with it ?

    February 21, 2015 at 1:14 am #141607
    Genesis Developer
    Member

    Navigate to Dashboard > Genesis > Theme Settings and there have header/footer scripts section. Put your javascript code in Header textbox section and it will solve your problem. You do not need to write any custom code for this.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    February 22, 2015 at 9:09 pm #141822
    BlogDaz
    Participant

    Thanks once again for the help, but I think I'm going to give up on this one, tried placing the script in the header/footer section but still no joy.

    February 23, 2015 at 3:21 pm #141918
    Brad Dalton
    Participant

    You can hook it in using a custom function but it seems your code is the problem because it should work in the Header Scripts meta box.

    Javascript is always a problem to get working in any theme.


    Tutorials for StudioPress Themes.

    February 23, 2015 at 8:16 pm #141967
    BlogDaz
    Participant

    Thanks for the suggestion Brad, might be a bit too technical for me though. I tries simple hooks already, I tried adding it to my template as a php file, as a javascript file, I copied the genesis header php and added to that then placed it in my child theme template. Probably you are right, it is my theme.

    February 23, 2015 at 10:25 pm #141979
    coralseait
    Member

    Do you have any server side or CDN caching? If so, you may have to flush it after changing the code or adding to Genesis Scripts or Simple Hooks.


    Coral Sea IT

    February 25, 2015 at 9:47 pm #142307
    BlogDaz
    Participant

    I'm on Bluehost WordPress hosting, from what I can see they are using varnish cache, and I don't believe I have any control over it.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Design Tips and Tricks’ 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