Greenlet comes with various WordPress action hooks. These hooks allow you to run a custom function at a specific point in the theme execution flow.
Example of a Greenlet action hook:
To run my_function
after Greenlet finishes rendering all the content you can use the following code in your child theme or custom plugin:
function my_function() {
echo 'After all the content!';
}
add_action( 'greenlet_after', 'my_function' );
The above code registers my_function
to run when Greenlet executes do_action( 'greenlet_after' );
which is located at /footer.php
Learn more about WordPress actions
All the available Greenlet actions are listed below
Articles
- greenlet_head
- greenlet_before_topbar
- greenlet_topbar
- greenlet_after_topbar
- greenlet_before_header
- greenlet_header
- greenlet_after_header
- greenlet_before_semifooter
- greenlet_semifooter
- greenlet_after_semifooter
- greenlet_before_footer
- greenlet_footer
- greenlet_after_footer
- greenlet_after
- greenlet_before_entry
- greenlet_entry_header
- greenlet_before_entry_content
- greenlet_entry_content
- greenlet_after_entry_content
- greenlet_entry_footer
- greenlet_after_entry
- greenlet_before_left_sidebar
- greenlet_after_left_sidebar
- greenlet_before_loop
- greenlet_loop