We are going to start at the very beginning by looking at the Thesis 2 file structure because the Thesis file structure is somewhat different than a typical WordPress theme structure.
And I’m going to show it to you here in an FTP client. This is the FTP account for the site that we’ve been working on here in the last couple of Thesis 2.3 seminars.
Standard WordPress Theme System
You understand that WordPress has the three primary directories, wp-admin, wp-content and wp-includes. And that all of your work, that is all customization in WordPress, happens inside of the wp-content directory.
Typically in WordPress, you have at a minimum these three directories. You have the plugins directory, the themes directory and the upload directory. This is where plugins get all the plugins and themes get all the themes and uploads gets the media library and whatever else various plugins may add.
This also has the must use plugins, upgrade and languages folders that are added by GoDaddy but they aren’t primary elements of the WordPress file structure.
However, and if we open up our themes section of the file structure, you can see that this site has 2016, 2017 and 2015 themes installed and it has the Thesis theme installed.
Well, in a standard theme customization system, or WordPress’ theme customization system, customization files goes inside the theme folder. You are probably familiar with style CSS and functions PHP which are files that are often edited by people who are customizing their theme. They’ll typically edit those two files.
Thesis 2 System Different than the Standard
Well, in Thesis you don’t do anything in the Thesis core. Period. There is nothing for you to edit here inside of Thesis. Everything that is editable is actually not inside the Themes folder but is inside this Thesis folder inside of wp-content that Thesis created when you installed Thesis.
Boxes and Skins Folder
If you installed Thesis and it installed correctly, then you’ve got this Thesis folder and inside of that you’re going to have a boxes folder and a skins folder.
I have seen it happen sometimes that people will install Thesis and then for some reason or another the process breaks down midway and you don’t end up with a Thesis folder or you’ve got a Thesis folder but not a skins folder. Essentially your only solution is to delete Thesis or to create these folders for yourself. Obviously it’s a simply method for doing that.
In the boxes folder are any boxes that you have installed. So far in the course of the last two seminars we installed that BYOB Classic Footer Widgets box and we installed the Thesis AWeber box. So those two boxes are sitting in there.
And then inside the skins folder is every skin that has been installed. So, in that case we’re working in Classic Responsive but you also have Effectus, Flex and my skin BYOB Agility Nude. So those are the four skins that we’ve installed in this site.
Do Not Edit CSS.CSS
Typically there is really only one file in here you should edit. And web designers who are really familiar with developing in WordPress sometimes miss this point. So they’ll open up their CSS file and they’ll edit the css.css file.
It’s the same thing you would do if you were in 2017 and you wanted to change something in CSS. You’d open up the style CSS file and you’d make a change in it.
Well, you can’t do that in Thesis because the css.css file is dynamically generated every time you hit save skin design or skin content. Every time you switch themes that css.css file is dynamically reconstituted from scratch so anything you actually put in there would be thrown away. That’s why you keep all of your editing to inside the browser so that that becomes part of that dynamic regeneration of the css.css file.
Custom PHP and Master PHP Can Be Edited
However, there is one file that you may want to edit. And that is custom php. Custom php is the file that lets you add php code snippets. It’s the functional equivalent of the functions php file in other themes.
We’re not going to do any of that but if you’ve asked a question on the forum and someone said just add this to your custom php file, this is what they are talking about. So there are things, hooks and filters that you can work on in Thesis and access them directly through php. This is the file that you would do it in.
Difference Between Custom PHP and Master PHP
If you look in the Thesis folder there is also another file and that’s master php. If you’re customizing an existing skin, the only two physical files you would ever customize are either master php or that custom php.
Changes to Master PHP Apply to Any Skin You Load
And the difference between them is that master php actually sits in the root of the Thesis directory inside of wp-content. Any changes you make to master php will apply to any skin that you load. So, it happens no matter what skin you install and what skin is activated.
Anything you put here is going to be activated when you ask it to be activated regardless of what skin it is.
Custom PHP is Skin Specific
Custom php is different. Custom php exists in every skin and it will only fire when that skin is active. So, if you want to make skin specific php stuff you’d put it in custom php. If you wanted to make it site specific so that it applied to the site no matter what skin was activated you would put it in master php.
The problem with that is that it is a little dangerous because you may be writing a little piece of php that acts on a filter that’s in the skin and that is not inside of Thesis and if it’s in master php obviously it will fire but it won’t return the results you expect because it’s trying to act on an existing skin.
Having said that those are your two php files that you would choose from if you are going to edit or write any php associated with your site.
If you want to know more about that I do have a introductory seminar you can watch, Introduction to Customizing Thesis 2.1 using PHP. I’m going to eventually redo it for the most current version of Thesis but right now in this regard they are almost identical. So looking at this will give you virtually the same information as the new one.
It used to be custom function php in Thesis 1. You used to have to get into that all the time but in Thesis 2 there are few rationales for doing that as you are going to continue to see. But there are some cases where you might want to add something to a hook or you might want to change a filter and that’s how you would do it.
That’s the Thesis file structure.