Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   Order of inserted code in theme's header.php (/showthread.php?t=11485)

brentwilliamz January 28th, 2015 07:01 AM

Order of inserted code in theme's header.php
Store ID: 46971
Website URL:

As directed below, I've removed your code from Simple Search Widget module & pasted it into my Graphene's child theme header.php (so it doesn't get overwritten when parent theme is updated):


<script type="text/javascript">
 * NOTE: This JS code would be much better off
 * existing in your theme's header.php file.
function wash( anInput ) { if(anInput.value == anInput.defaultValue) anInput.value = ''; }
function checkWash( anInput ) { if(anInput.value == '') anInput.value = anInput.defaultValue; }

Is there any particular placement of for your code in the header.php file, eg. start or end of file? Or is this never critical? :(

Eric January 28th, 2015 09:46 AM


It shouldn't matter at all just as long as it's placed somewhere between the <head> and </head> tags.


brentwilliamz January 29th, 2015 08:42 AM

Good, Eric, didn't think so. Have done as instructed, ta.

What about code pasted into a Store's Custom CSS sometimes I've seen it specified "at very end of file"?

PHP versus CSS: Are they 2 different kettles of fish in how they operate or are read & acted on?

Eric January 29th, 2015 10:29 AM

Code pasted into your Custom CSS should always be pasted at the bottom of the textarea where you paste it into unless otherwise noted.

PHP & CSS are completely different. More like PHP is the brains of the fish and CSS is the color and shape of the fish.

brentwilliamz January 31st, 2015 01:11 AM

Ahhhh, much clearer now. Ta. :)

All times are GMT -5. The time now is 12:50 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.