Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




post_type_archive_title [ WordPress Function ]

post_type_archive_title ( $prefix = '', $display = true )
Parameters:
  • (string) $prefix Optional. What to display before the title.
  • (bool) $display Optional, default is true. Whether to display or retrieve title.
Returns:
  • (string|null) Title when retrieving, null when displaying or failure.
Defined at:



Display or retrieve title for a post type archive.

This is optimized for archive.php and archive-{$post_type}.php template files for displaying the title of the post type.

Source


<?php
function post_type_archive_title$prefix ''$display true ) {
    if ( ! 
is_post_type_archive() )
        return;

    
$post_type_obj get_queried_object();
    
$title apply_filters('post_type_archive_title'$post_type_obj->labels->name );

    if ( 
$display )
        echo 
$prefix $title;
    else
        return 
$title;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics