Although they are similar to WordPress themes, Thesis Skins are more powerful because of all the functionality they inherit right out of the box.
Skins are deeply integrated into both WordPress and Thesis, giving you the ability to create admin pages, manage options, and exercise precise control over content.
To tap into the awesome power of the Thesis Skin API, you must first create a Skin.
Create a Thesis Skin
Just like Boxes, Thesis Skins are a classic example of object-oriented programming (OOP). Through the concept of inheritance, every Skin receives basic functionality and access to the awesome Skin API.
class my_skin_class_name extends thesis_skin { /* Skin properties and methods go here */ }
In PHP, object inheritance is achieved through the extends
keyword, as seen in the above snippet. In this case, thesis_skin
is the base Skin objectβit contains all the basic Skin functionality coupled with the Skin API, which can be used by the extending object (your Skin).
Now that your Skin is alive and kickin’, let’s take a closer look at the Skin API and what you can do with it.
Skin API Components: How to Build a Dynamic Design
Unlike Boxes, all Skin properties and methods are optional. Because of this, your Skin could, in theory, be no more complicated than the example code shown above.
However, if you want your Skin to be dynamic and interesting, you’ll need to add some options. Lucky for you, the Thesis Skin API makes this process both easy and fun.
Design and Display Options
Properties
$design
β array of currently-selected Design Options (if applicable)$display
β array of currently-selected Display Options (if applicable)$functionality
β initiate optional functionality and override certain default Skin behaviors
Objects
$color
β design color tools$css_tools
β tools for creating CSS options and also outputting CSS$fonts
β Thesis font controller$grt
β Golden Ratio Typography tools$header_image
β header image controller (if applicable)$typography
β design typography tools
Methods
admin_ajax()
β add custom ajax actions to the Thesis Adminboxes()
β register Skin add-on Boxescolor_scheme()
β color scheme picker (used withdesign()
)construct()
β the Skin pseudo-constructorcss_variables()
β implement Design Optionsdesign_admin()
β override the default Design Options pagedesign()
β set up Design Optionsdisplay()
β set up Display Optionsdisplay_elements()
β implement Display Optionsfilter_css()
β filter CSS whenever the stylesheet is writtenfonts()
β add fontsinit_design_admin()
β add CSS or JS to the Design Options pagewoocommerce()
β add front end actions and/or filters for WooCommerce template compatibility