WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/in the loop

Contents

Description

Whether the caller is in The Loop (i.e. whether the loop is currently active).

Usage

<?php in_the_loop(); ?>

Parameters

none.

Return Value

(boolean) 
True if caller is within loop, false if loop hasn't started or has ended.

Changelog

Since: 2.0.0

Source File

in_the_loop() is located in wp-includes/query.php.

See also index of Function Reference and index of Template Tags.