get_template_part

FUNCTION wp-includes\general-template.php (ligne 116) github
Fires before the sidebar template file is loaded.

Paramètres

Entrée :
$slug, $name = null, $args = array(
Sortie :
@param string|null $name Name of the specific sidebar file to use. Null for the default sidebar.
@param array       $args Additional arguments passed to the sidebar template.
@param string      $slug The slug name for the generic template.
@param string|null $name Optional. The name of the specialized template. Default null.
@param array       $args Optional. Additional arguments passed to the template.
@return void|false Void on success, false if the template does not exist.

Utilisation

// Utilisation de la fonction get_template_part
$result = get_template_part($slug, $name = null, $args = array();

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

Actualités

Chargement des actualités...