Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Inserting Javascript on main page won't work but individual pages will (http://forum.bytesforall.com/showthread.php?t=1230)

everydayexplorer Apr 11, 2009 05:21 PM

Inserting Javascript on main page won't work but individual pages will
I'm trying to insert this piece of code into the theme

<script type="text/javascript" src="http://www.avantlink.com/ale/ale.php?ti=401"></script>

At first I tried using the HTML/CSS Inserts and inserting it into the header and/or body bottom but that only worked on individual posts meaning that it was only active when you clicked on a single post and were viewing a single post.

I then tried following these directions


and installing it at the end of footer.php before the closing </body>. I ran into the same problem.

I then tried inserting it into header.php and it once again only worked on individual posts. I am using firebug to troubleshoot and the odd thing is I that the code doesn't even show up in the header in firebug on the main page but it shows up fine on individual posts.

I should also mention that the script works fine when I click on Older Entries and view multiple posts that are not on the front page.

Is there a separate header file for the main page or is there another way that I can enter this script on the main page?

everydayexplorer Apr 11, 2009 05:44 PM

The problem "magically" resolved itself. No idea how. If there is a better solution rather than putting it in header.php I'm all ears.

Flynn Apr 11, 2009 10:31 PM

I'd follow the suggestion of the Javascript author regarding the best location, there is no single best location for Javascript. Some recommend to put Javascript at the bottom, before the closing </body> tag so it won't delay the page load. The site might load faster, or at least appear to do so.

All times are GMT -6. The time now is 01:46 PM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.