View Full Version : I can't find my site's HTML pages on our server, using Wordpress CMS.

The Noob Coder
08-01-2012, 08:39 PM
My company uses Wordpress as their CMS, and I wanted to edit some of their web pages. For the life of me, I don't know where the actual HTML pages are kept on the server. Does anyone know where I would find them by default if they are using Wordpress? I found all the media (images, etc.) that the site uses on the server in a WP directory, but I can't find the actual HTML files.

Right now I have to settle for editing the page through the WP editor and it's annoying because I only have access to the contents within the body tag! :(

I think they host with GoDaddy, if that matters.

08-02-2012, 12:08 AM
The template files are located in /wp-content/themes/[theme name]

The Noob Coder
08-02-2012, 12:39 AM
The template files are located in /wp-content/themes/[theme name]

I don't see any HTML files here though. Mostly php and a single CSS file.

08-02-2012, 03:56 AM
OK, I was actually gonna write that in the first place but then I thought I might have misunderstood you, but now I’m writing it again because apparently I was actually right:

Wordpress – or any CMS that works with a database – doesn’t save actual static HTML files on the server that you can edit and transfer via FTP, it stores all the contents in a database, retreives them from there, and the PHP of which Wordpress is made compiles a page on the fly by putting various templates (code snippets) together and including the contents retreived from the database. This is the purpose of a standard CMS and this is why all the content is edited from the CMS’s admin panel, so that anybody can edit the content from anywhere right in a web browser, even without much knowledge of HTML.

Now, if you want to make structural changes to the code of the pages you see when you view your website you need to edit the template files. As mentioned, templates are pre-made code snippets that are put together to form the page. In the theme directory I mentioned in my previous post you find, for example, a header.php and footer.php file. If you open these with a text/code editor you see the HTML for the page header/footer in there, together with some PHP code that makes the page more dynamic (e. g. by showing the relevant title for each page). Also, there are more template files, the index.php file being the standard posts template and page.php the standard template for pages. If you edit the HTML in these files you will see the changes when you load a page or the post overview in the browser.

The Noob Coder
08-02-2012, 06:32 AM
Thanks for the detailed response. So I guess I have to edit those PHP files to see any results on the pages I need to edit.

The Noob Coder
08-02-2012, 11:15 PM
So I found the file that corresponds to the footer of the page and was able to make a few edits that I needed to make. Now I'm hunting for a few other parts of the site. Specifically where ever the CSS that controls the font is stored and the header (it's contents and such).

I found a file called header.php in the same directory as the footer.php that I edited. However, that header file doesn't seem to have the elements that you see in the header on the page at the website. For example on the website (Click here to see it (http://www.convolutedconstruct.com)), there is an image in the header along with a menu that I really need to edit (the font in the menu is an image and I need to make it actual text). Where could I search to find and edit the elements in the header?

08-03-2012, 02:40 AM
The text in the menu is not an image, it’s generated through Cufón (http://cufon.shoqolate.com/). However, since most modern browsers support @font-face nowadays, scripts like these aren’t really necessary anymore. As this appears to be a Wordpress plugin the only thing you need to do is disable/remove it from within the admin area.

Looking at the source code it looks like this is a fairly intricate theme with a lot of sub directories and includes and stuff. The best way to edit such a theme is downloading the entire theme directory, looking at the output source code in the browser for the element you want to edit, and doing a multi-file search (any decent code editor program can do this) for the element. This way you will easily understand the structure of the theme.

However, depending on the complexity of the theme there might be things that are specified in the admin area, not in the theme files. For example, if the theme has a dynamic menu the menu items are also stored in the database, not as actual HTML in a file, so that is edited in the “menus” in the admin area. Look if the theme has specific settings.