WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/is search

Contents

Description

This Conditional Tag checks if search result page archive is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE.

Usage

<?php is_search(); ?>

Parameters

This tag does not accept any parameters.

Return Values

(boolean) 
True on success, false on failure.

Examples


<?php
if ( is_search() ) {
    
// add external search form (Google, Yahoo, Bing...)
}
?>

Notes

Change Log

Since: 1.5.0

Source File

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

Related

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