0

I have a WordPress website set up and currently have a default WordPress theme, I want to edit the appearance of the webpage myself using CSS as the basic edit tools on WordPress' are too limited and basic.

Which are the specific files I need to go into to edit say the homepage appearance using code?

Ryman Holmes
  • 746
  • 3
  • 22
  • 40

4 Answers4

3

Each theme's files are located in:

${ROOT}/wp-content/themes/${THEME_NAME}

You should find your current one there, and can edit it using better tools.

Also, have a look at WordPress's theme documentation.

Nick Veys
  • 23,458
  • 4
  • 47
  • 64
1

You must use the editor which is available under the Appearance menu on the left side of the dashboard. When you click on the editor, you will be taken to the Stylesheet. From there you can add your CSS that you desire. If you plan on editing HTML and PHP, you must click on the files towards the right after you have clicked the editor link. Look for the header.php, footer.php, and so on. Those are the files that are loaded whenever a new page is requested by a user. In addition to the header and footer files, a good theme will have different template files. For example, it might have a homepage template. If you want to change the look of your homepage, you must go to the homepage.php file and edit it to how you would like. You still access that file the same way as you get to the stylesheet, through the editor menu. Look at the page template that you're using and make sure that you're editing template or it can be disastrous.

Mardin Yadegar
  • 437
  • 4
  • 10
  • Yes I understand that, but how do I know which element is where? for example if in the `styles.css` script there is a class declared called `.sidebar` how am I supposed to know where that is on the HTML page, i'm finding it difficult to link the two up – Ryman Holmes Aug 06 '13 at 22:19
  • Well the sidebar would be in the sidebar.php file. If you want to make custom edits to the sidebar, you'll have to check in the sidebar.php file. Each element is usually in its own file. For example, the logo of a site, and the main navigation will be in the header.php file because those are typically found in the
    . You should chat me because I can answer these questions as I have worked in WordPress for over 3 years now and have a lot of experience with it.
    – Mardin Yadegar Aug 06 '13 at 22:23
  • By the way, there are no HTML pages in WordPress. Everything will be in PHP because HTML is Static whereas PHP can change based on specific conditions. – Mardin Yadegar Aug 06 '13 at 22:24
  • I don't know if you can use it yet. But I guess you can just ask me questions here, and I can answer them for you. Is what I am saying making sense? – Mardin Yadegar Aug 06 '13 at 22:55
  • How do I find out which PHP page the navigation menu is – Ryman Holmes Aug 06 '13 at 22:58
  • That would be in the header.php file. It is just common sense for more of them. Where would you find a navigation bar, in the middle of the content, or at the top? Typically, you find it at the top. For that reason, it is in the header.php – Mardin Yadegar Aug 06 '13 at 23:00
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/34950/discussion-between-ryman-holmes-and-mardin-yadegar) – Ryman Holmes Aug 06 '13 at 23:08
  • Ryman - The location of various classes and so on varies wildly by theme. WordPress is essentially just a collection of templates that get compiled into a single HTML page by the server when a visitor requests a page. However, the structure of those templates and the classes used within them are all dependent on how the theme developer set things up. – Chris Ferdinandi Aug 14 '13 at 15:21
0

Most of the wp themes have the files below, so these files are what you need to edit.

  • style.css
  • index.php
  • archive.php
  • 404.php
  • comments.php
  • footer.php
  • header.php
  • sidebar.php
  • page.php
  • single.php
  • functions.php
  • search.php

You just need to know about the div+css a little, so that you can edit the wp theme. Me too, i only know about some div+css ^_^

Ring
  • 31
  • 4
0

If you're brand-spanking-new to this, I'd recommend taking a look at Naked WordPress. It's a barebones WordPress theme with TONS of inline documentation to help you learn what each line of code does. http://bckmn.com/naked-wordpress/

Also, the comments about looking at the WordPress documentation are spot on. You really need to better understand what the files in WordPress do if you want to do this effectively.

Chris Ferdinandi
  • 1,892
  • 4
  • 26
  • 34