Skip to content
Jeff edited this page Mar 9, 2015 · 2 revisions

Functions file structure

In the root of our custom theme folder is the usual functions.php. This file requires the various function files in the includes/ folder.

Default dharma functions

There are three files that define some base functions and settings that are common to just about every project.

  1. om-configure.php

    This file contains several functions that are activated through WordPress filters and actions to customise various settings.

  2. om-dashboard.php

    This file contains functions developed to modify the WordPress Dashboard to assist our clients once the site is turned over. Things like custom WordPress alerts, etc.

  3. om-functions.php

    This file has functions for common needs when developing a custom theme.

These files should generally not need to be editing. If editing is required, remember to file an issue or pull request with the change.

Starter theme functions

The files beginning with theme- are files that are used as a starting point for the custom theme. They contain some helpful starting points but can be edited as needed. If certain functions are consistently being added to theme-functions they should be considered for addition to om-functions.

  1. theme-functions.php

    This file contains the CSS & JS registering functions to include theme assets appropriately using get_header() and/or get_footer() functions. Any other functions can be added to it as needed.

  2. theme-require-plugins.php

    This file contains an array of plugins that can be marked as "required" and will trigger an alert in the WordPress Dashboard if not installed/activated. Some likely plugins are included, and the list can be edited as required.

Clone this wiki locally