1. Home
  2. Docs
  3. Greenlet Hooks
  4. Actions
  5. greenlet_before_loop

greenlet_before_loop

do_action( ‘greenlet_before_loop’ );

Fires before greenlet_loop action after the main opening tag is rendered.

Description

This action can be used to render any component or perform any action before the main posts loop. This action is triggered irrespective of the existence of any post.

Example Usage

function mytheme_before_loop() {
	// do_something();
}

add_action( 'greenlet_before_loop', 'mytheme_before_loop' );

Notes

Registered actions in Greenlet Theme

greenlet_breadcrumb in library/frontend/main-structure.php
greenlet_archive_header_template in library/frontend/main-structure.php

Remove BreadCrumb

Breadcrumb can be completely removed with:

function mytheme_remove_breadcrumb() {
	remove_action( 'greenlet_before_loop', 'greenlet_breadcrumb', 2 );
}

add_action( 'greenlet_init', 'mytheme_remove_breadcrumb', 20 );

Remove Archive Header

Archive Header Template can be completely removed with:

function mytheme_remove_archive_header() {
	remove_action( 'greenlet_before_loop', 'greenlet_archive_header_template' );
}

add_action( 'greenlet_init', 'mytheme_remove_archive_header', 20 );