WP Theme Components
WP Theme Components is a simple framework for resusing code between themes.
- Download the latest release
- Copy the
components.phpfile into your theme directory.
- Include the
components.phpfile in your
functions.phpfile or similar.
From A Repository
- Clone the component's repository into the
theme-componentssubdirectory in your theme directory.
- Alternatively, download the latest release and copy the component folder into
Creating A New Component
- Create a folder inside a
theme-componentssubdirectory in your theme directory
- Inside the component folder, create a
- For best results, include a docblock in the following format:
/** * Component Name * * @author Author Name * @version Version Number (X.Y.Z) * @link URL for a repository if one exists * @package WP_Theme_Components * @subpackage Name_Of_Your_Component */