post_type_archive_title [ WordPress Function ]
post_type_archive_title ( $prefix = '', $display = true )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: is_post_type_archive, get_post_type_archive_link, get_post_type_archive_feed_link, is_post_type_hierarchical, post_type_exists
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
- Function Reference/post type archive title « WordPress Codex
Description. Display or retrieve title for a post type archive. This is optimized for archive.php and archive-{posttype}.php template files for displaying the title of the ...
codex.wordpress.org - #18614 (post_type_archive_title doesn't work when tax_query is ...
To get the data for the post type object, post_type_archive_title( ) calls get_queried_object( ). This is problematic. If the query has been altered in any way (such ...
core.trac.wordpress.org - Need post_type_archive_title function but in 'single'
Feb 1, 2012 ... In the archive-[cpt].php I can use post_type_archive_title() and it echo the name. How would I get this same title in a single view? Thanks!
wordpress.stackexchange.com - post_type_archive_title() WordPress function reference, arguments ...
post_type_archive_title(). Display or retrieve title for a post type archive. This is optimized for archive.php and archive-{$post_type}.php template files for ...
queryposts.com