The What
Description
This is an action event with the Genesis theming framework. Its intent is to initialize the web page before the rest of the web page construction begins.
In your child theme, you load this file by including the file genesis/lib/init.php
. In this file, various callbacks are registered to first initialize the theming framework, such as:
- Loading the theme’s textdomain for internationalization
- Loading all the various theme supports, including menus, layouts, settings, and more.
- Adding the Genesis-specific supports for both the post and page post types.
- Adding in the post meta supports.
- Declaring and defining the constants.
- Loading in the framework’s files.
When the event genesis_init
fires, each of the pre-registered callbacks (see the add_action Docx for more information) are invoked, i.e. meaning they run one-by-one in order.
In your theme or plugin, you register callbacks to this event when you need things initialized before the page begins to be built when genesis()
is called.
Syntax
You register your callback as follows:
bool add_action ( 'genesis_init', callable $callback_name, integer $priority = 10 );
The event is then fired from the genesis/lib/init.php
file using do_action( 'genesis_init' );
.
Parameters
This function does not accept any parameters.
Return Values
It does not return anything.
Your functions are bloated. Put them on a diet. Think "skinny" and "as few lines as possible."
Not to worry…more is coming very soon…keep checking back.