Design System is here - Read the release post

Learn GeneratePress

Developers

Document hooks

These hooks fire on every page, in the document <head> and around the <body> element.

Where the document hooks fire A vertical wireframe of the page document showing wp_head in the head, wp_body_open just after the opening body tag, and wp_footer before the closing body tag. The same hooks are listed in firing order in the text list below this diagram. <head> wp_head <body> (top) wp_body_open <body> (bottom, before </body>) wp_footer

Hooks in firing order

  1. wp_head
  2. wp_body_open
  3. wp_footer

Document

GP Free

The wp_head hook is a standard hook in WordPress, and should only include things that go into the <head> section of your website.

Parameters: none. Default: —.

add_action( 'wp_head', function() {
    ?>
    <div class="my-notice">Insert your content here.</div>
    <?php
} );

Guide: Developers

wp_body_open

GP Free

The wp_body_open hook is placed immediately after the opening of the body tag.

Parameters: none. Default: —.

add_action( 'wp_body_open', function() {
    ?>
    <div class="my-notice">Insert your content here.</div>
    <?php
} );

Guide: Developers

GP Free

The wp_footer hook is a standard hook in WordPress that appears before the closing </body> element of your website.

Parameters: none. Default: —.

add_action( 'wp_footer', function() {
    ?>
    <div class="my-notice">Insert your content here.</div>
    <?php
} );

Guide: Developers

Back to top