A way to organize theme files.
theme/
└─inc/
├─static.php # wp_enqueue_style() and wp_enqueue_script()
├─menus.php # register_nav_menus()
├─hooks.php # add_filter() and add_action()
├─helpers.php # Helper functions and classes
├─widgets/ # Theme widgets
│ ├─{widget-name}/
│ │ ├─class-widget-{widget-name}.php # class Widget_{Widget_Name} extends WP_Widget { ... }
│ │ ├─some-file.php
│ │ └─some-dir/
│ │ └─...
│ └─...
└─includes/ # All .php files are auto included (no need to require_once)
├─some-file.php
└─...
helpers.php
,hooks.php
,includes/*.php
are included right awaystatic.php
is included onwp_enqueue_scripts
actionwidgets/{hello-world}/class-widget-{Hello_World}.php
are included onwidgets_init
action
- Download the archive
-
Extract it to your theme root directory
-
Include the
init.php
file from your themefunctions.php
include_once get_template_directory() .'/inc/init.php';