is_active_sidebar

FUNCTION wp-includes\widgets.php (ligne 971) github
Determines whether a sidebar contains widgets. For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.

Paramètres

Entrée :
$index
Sortie :
@param string|int $index Sidebar name, id or number to check.
@return bool True if the sidebar has widgets, false otherwise.

Utilisation

// Utilisation de la fonction is_active_sidebar
$result = is_active_sidebar($index);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...