Finding </body>

JasonG

Regular Member
Joined
May 28, 2009
Messages
318
Reaction score
93
Okay - back story: I have always used xsitepro to make my sites due to its wysiwyg editor, never touched WP, meaning I have never used an ftp client (filezilla).

onto my situation: I have a script I want to put on my site, and the instructions say "paste (the script I have) right in front of the </body> tag in your code."


Well - I have no idea how to find that - I am doing sort of a WP test blog to learn how to use it, have the thesis theme, and I have no idea how to get to the place where I can see this </body> tag


I hope I am clear with all of this - anyone have any suggestions or know what I am talking about?

Thanks will be given.

Jason
 
one thing that works.

bring up the webpage you are working on.
then right click on it
this should bring up a link for page source

then do ctrl F on your computer and it should help you find

type in the phrase you are looking for
(control F will search)
 
i dont know thesis. but if you get the firebug firefox plugin. you will be able to see the code and determine which file it is in. then you can download that file or edit on the fly in ftp and that should be it.
 
ctr+F :rolleyes:
type </body>

and thats it....no need to press enter if you are using Chrome
 
Thanks guys, will try this out now. I'm not the most tech savvy, but I think I can figure this out. Thanks given :)
 
I might be misunderstanding but depending on what theme you are using you usually can find the /body tag in the footer file of your theme.

In wordpress it will build as follows. index -> header -> sidebar -> footer

Unless you are using something wierd.
 
In WP, the </body> tag will probably be inside footer.php, ie. inside wp-content/themes/yourthemename/footer.php.

Very occasionally it will be in the bottom of the file that generates the page body ie. index.php, single.php, category.php, archive.php etc - but generally it's in footer.php so check there first.
 
okay - so i guess I am still kind of lost

I understand how to view the source of my site, and I found where the </body> is - pretty much at the bottom, but how do I get to it via the file within filezilla access it and change it or paste in the code for the script? is it going to be in the public_html folder? after I go into that there are like 10 other folders and about 20 little white looking file things (like I said I am not tech savvy) lol
 
FTP into the directory into which you uploaded your WP site.

Say your theme name is "thesis":

Then you would navigate to wp-content/themes/thesis.

Then look for the file called "footer.php" and open it.

You should see the closing </body> tag in there, and you can insert whatever code you need into the file and save it (or upload it to the right place if you were editing it locally on your PC).

I would highly recommend learning some basic html, it is absolutely essential to making money online.
 
In WP, the </body> tag will probably be inside footer.php, ie. inside wp-content/themes/yourthemename/footer.php.

Very occasionally it will be in the bottom of the file that generates the page body ie. index.php, single.php, category.php, archive.php etc - but generally it's in footer.php so check there first.

Thanks Autumn - I was able to find the footer file, but, within it when I opened it to edit it I didn't see that body tag anywhere within that...

this is like a freakin' needle in a haystack situation lol
 
Try looking in all the .php files (index.php, single.php etc) in the base directory of your site. It's possible that thesis uses some funny structure instead of including the closing </html> tag in the footer.
 
okay, I found it in frameworks.php pasted the script in right before the body tag, and when I refreshed the site it gave me this...


Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/wptest/public_html/wp-content/themes/thesis_18/lib/html/frameworks.php on line 24
 
What was the script your inserted into the page? PHP or javascript? Chances are that there is a single or double quote in your inserted script that you need to escape with a backslash.

eg. you will probably have to turn this:

'

into this:

\'

or this:

"

into this:

\"

or there could just be an error in the script you inserted.
 
Code:
<script src="peel/peel.js" type="text/javascript"></script>

was the script I was trying to use - so I guess javascript. is this not going to work then?
 
It should work. If the html is being printed via PHP then you will need to escape the double quotes in that script with backslashes, ie. try changing the script to:

Code:
<script src=\"peel/peel.js\" type=\"text/javascript\"></script>
 
Okay Autumn - so I put that code in right before the body tag, it didn't cause any errors when I opened the site, but it isn't doing what it is supposed to do...

You know the peel backs at the top corner of websites? That is what this is supposed to do but, no luck...

Could I PM you with a few more details? I don't want to get too specific and blow up my site/niche...
 
Unfortunately beyond telling you to check the path to your javascript on your server to make sure it's correct, there's not much more I can tell you without poking around your full setup. You can try looking for javascript errors using the Firefox javascript console (Tools > Error Console) which will print a list of javascript errors.
 
After reading more of this i am pretty sure there are some page peal plugins that would be easier for you to use and set up.

http://wordpress.org/extend/plugins/page-peel/
http://wordpress.org/extend/plugins/jquery-page-peel/

There is a flash and a jquery version. There are a ton more.
 
Back
Top