Build Your Own Business Website header image

Thesis 2.0 – Where to Add Custom PHP to a Skin

Difficulty Level -

Filed Under Topics - , ,

Listed Under Lesson Subjects -

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

In this session we show where to add custom PHP to a skin. When a skin is uploaded it will be installed in the Thesis Theme Directory inside the wp-content folder. Skin authors will use the skin.php file while skin users will use the custom.php file. We discuss what happens to these files when both Thesis and the skin are updated.

Video Transcript

Okay let’s see, Pierre asks, “How can I use my cool php snippets?” Well, in the first place, most of your cool php snippets aren’t going to be needed here. So you’re going to look at your php snippets and ask yourself whether or not there’s any value in them.

But to the extent that you decide that there is value in them or there’s something you want to use then you will use the custom php file in the skin. I’m bringing up my code editor here so you can see what I’m talking about. We didn’t talk about the file structure in Thesis here. But when Thesis is installed, inside of the wp content themes folder, it creates its own folder and places all of its core stuff there. And outside of the themes folder, inside of wp content, it also creates another Thesis folder. And that other Thesis folder, it creates a boxes, a packages and a skins folder. And inside that skins folder, it puts the classic… it puts the default skins in.

And if you upload a skin from someplace like if you upload my agility skin and install it, it will be installed in this directory, in the Thesis skins directory that’s inside of wp content. It will not get installed in the Themes directory. And inside each of these things is this custom php file. And if you’re going to write custom functions that you want to apply to a specific skin, you can use your custom php file to do so.

Now if it’s your own skin, you can always use skin php. But if it’s a skin that you’re using from somebody else, the update process may update the skin php, will update the seed php but will not update the custom php. And so this is the way in which skins are upgrade-proof where you can essentially upgrade the core of the skin without it changing any of your customization. So your custom functions, your custom code snippets would go here.

Now I can promise you though that 90% of those are probably not going to be needed. But anyway, that’s where you would do it.

0 Comments… add one

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
Subscription Options
0 comments… add one

Leave a Comment