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/*.phpare included right awaystatic.phpis included onwp_enqueue_scriptsactionwidgets/{hello-world}/class-widget-{Hello_World}.phpare included onwidgets_initaction
- Download the archive
-
Extract it to your theme root directory
-
Include the
init.phpfile from your themefunctions.phpinclude_once get_template_directory() .'/inc/init.php';