Which file to edit?


Posted on Saturday, April 9th, 2011


Which files should i edit?

There will undoubtedly come a time when you want to edit or customize the theme files, the purpose of this tutorial is to give you an idea of which files do what and which are safe to edit and which are not.

The basic rule

All editable theme files start with an underscore, e.g. “_header.php” and not “header.php”

Why shouldn’t i just edit any file?

To make the process of customizing, editing and upgrading PremiumPress themes easier for you, we have, where possible, separated core theme functions from design elements. This means that whenever possible you should only edit child theme files to ensure that during upgrades your work is not overwritten.

The files/folders that are labeled with a red cross () are core theme files and maybe updated during theme upgrades therefore they SHOULD NOT be edited, those with a green tick () are template files that will not be upgraded during theme upgrades.

Notes: For this example we will use the CouponPress theme however all theme structures are the same.

Path File Name Description Should Edit
admin/ ALL FILES contains admin area files
images/ ALL FILES contains linked images for admin
PPT/ ALL FILES contains core functions
author.php linked to _author.php
comments.php linked to _comments.php
footer.php linked to _footer.php
functions.php stored the current theme version numbers
header.php linked to _header.php
rtl.css not used but part of WordPress
sidebar.php linked to _sidebar.php
single.php linked to_single.php
style.css not used, stores theme version only
tpl-add-article.php linked to _tpl-add_article.php
tpl-add.php linked to _tpl-add.php
tpl-articles.php linked to _tpl-articles.php
tpl-callback.php linked to _tpl-callback.php
tpl-checkout.php linked to _tpl-checkout.php
tpl-contact.php linked to _tpl-contact.php
tpl-edit.php linked to _tpl-edit.php
tpl-messages.php linked to _tpl-messages.php
tpl-myaccount.php linked to _tpl-myaccount.php
tpl-payments.php linked to _tpl-payments.php
tpl-people.php linked to _tpl-people.php
tpl-stores.php linked to _tpl-stores.php
_countrylist.php stores the list of form countries
_link.php used for link cloaking
404.php linked to _404.php
_print.php used for displaying printable items.
themes/ YOU SHOULD EDIT CHILD THEME FILES  
template_THEMENAME/
language_english.php stores the website language array, edit this file if you would like to edit your website text.
styles.css stores the default website styles
system_customdesign.php custom theme design functions are in here
system_customfields.php admin area custom fields are in here
system_customlogins.php the member login/registration and lost password forms are in here
_404.php used for 404 (page cannot be found) pages
_articlepage.php will display website articles instead of the _single.php
_author.php will display member history
_block_packages.php membership package options
_comments.php linked to _single.php/_articlepage.php for display comments
_footer.php website footer
_gallerypage.php main gallery page for displaying listings
_header.php website header
_homepage.php home page
_item.php main item block displayed through the website
_item_small.php/item_gallery.php used for alternative styles/display as the above
_page.php display WordPress page content
_sidebar.php right sidebar
_sidebar1.php left sidebar
_single.php main listing page
_tpl_add-article.php article submission form
_tpl_add.php main submission form
_tpl_articles.php article display page for category/new listings
_tpl_callback.php used for sending members back to your website after a payment has been made
_tpl_checkout.php used for some themes with checkout options
_tpl_contact.php contact page
_tpl_edit.php member editor for editing existing website listings
_tpl_messages.php messages page for viewing messages
_tpl_myaccount.php my account page
_tpl_payments.php used with some themes for quick payment options
_tpl_stores.php used for displaying stores in couponpress