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

greenlet_loop

do_action( ‘greenlet_loop’ );

Fires after greenlet_before_loop action and before greenlet_after_loop action.

Description

This action can be used to render any component or perform any actions before the main posts loop by specifying the $priority less than 10 and after the main posts loop by specifying the $priority greater than 10

Example Usage

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

add_action( 'greenlet_loop', 'mytheme_do_something' );

Notes

Registered action in Greenlet Theme

greenlet_do_loop in library/frontend/main-structure.php

Remove main posts loop

Main posts loop can be completely removed with:

function mytheme_remove_loop() {
	remove_action( 'greenlet_loop', 'greenlet_do_loop' );
}

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