HTML source code?
-
Hi. Can you tell me how I can find the HTML source code for my blog? Thanks.
-
You go to your blog, then you click on view then source (if on Internet Explorer) or page source (if on firefox)
Thanks for your reply, sorry I didn’t make myself clear. I want to add something to the HTML. In WP, how can I access the code so I can modify it?
You’ll have to edit the .php files.
Index.php
Header.php
Sidebar.phpetc. …
If your using wp 1.5 you have to go to your blog directory > wp-content > theme > default or whatever your using and edit the PHP
if your using WP 1.2 the fiels should in your blog directory
Or you can login to your admin panel go to themes then theme-editor
If you want to change the look modifity the stylesheet (wp-layout.css or style.css). The other files usually vary, if you want to change the menu on the side look for sidebar.php, if you want the main index look for Main Template or index.php
I use WP 1.5. If I want to add a java script popunder to my blog I need to paste the code inside the <head>. I’ll find this info in which file? Thanks.
In the header.php for the theme you are using.
I couldn’t find a header.php in my > wp-content > theme > dots directory in my blog or in my dots directory on my hard drive. Any ideas? When I find it do I ftp the file from my blog to my hard drive and edit it and then upload it? Thanks.
Oh did you create that theme from a 1.2? Then it might not be separated out. It is probably in the index.php then, in the theme folder.
Yes, thanks for bringing that up. I’m using an updated 1.2 theme. I found index.php in themes/default. Does that sound like what I should modify? Also, can I do this from the index.php on my drive or is the way to do it to ftp it from the blog to drive, modify and then upload? Thanks.
Look at your index.php file from top to bottom if you see the <head> meta tags title and stuff near the top just add the javascript between the heads tags. If it jumps from including wp-blog-header.php to the
<?php if (have_posts()) : ?>(main content) with a few include lines in between I would look in the files that the index.php is including them in. For example I have index.php which has an include to header.php and mainmenu.php and all my javascript code is in the header.php file.As for the FTP, you could download/edit/upload but i find it easier to just edit the file from wp-admin if it’s just adding a piece of javascript code.
Thanks. So are you saying that in my ftp I could open the file and modify it there? If so, is just closing it actually “saving it?”
I just checked the php.index and didn’t see any kind of <head> info, seemed to mostly be about permalink. Where should I check next? Thanks again.
You can just edit in FTP and close it expecting it to be fixed. Unless you are on windows default ftp client you have to download edit save then reupload.
All the <head> stuff is in your index.php OR linked from the index.php file. To find it:
1) Open your index.php file, look for the code similar to
<?php include “a long directory/header.php”; ?>
2) Look at the the file listed (header.php) for the <head> tags. If it’s not there look at the nest php include and so on and you should find it
The topic ‘HTML source code?’ is closed to new replies.