Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Inserting Javascript on main page won't work but individual pages will


  #1  
Old Apr 11, 2009, 05:21 PM
everydayexplorer
 
2 posts · Apr 2009
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

http://www.avantshare.com/blog/2008/...ordpress-blog/

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?

Last edited by everydayexplorer; Apr 11, 2009 at 05:28 PM. Reason: clarity
  #2  
Old Apr 11, 2009, 05:44 PM
everydayexplorer
 
2 posts · Apr 2009
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.
  #3  
Old Apr 11, 2009, 10:31 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
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.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting javascript in body of post wolfclick Atahualpa 3 Wordpress theme 7 Jul 2, 2010 10:07 PM
[SOLVED] Don't show sub-pages for a main page on my menu bar jockoe Atahualpa 3 Wordpress theme 1 Jul 13, 2009 12:28 PM
How to make the Pages display in sidebar, show only the Parent Main Pages Leoni Sidebars & Widgets 2 May 27, 2009 12:13 AM
HELP PLEASE! Trying to use Stray Random Quotes Widget - Won't Work.... laurastone Sidebars & Widgets 1 Mar 30, 2009 05:33 PM
Need help! how to set up Atahualpa theme's main page with links to pages? Marylander Excerpts, Read more, Pagination 0 Mar 18, 2009 09:17 AM


All times are GMT -6. The time now is 04:31 PM.


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