WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/post type archive title

Contents

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 post type.

Usage

<?php post_type_archive_title$prefix$display ); ?>

Parameters

$prefix
(string) (optional) What to display before the title
Default: None

Note: The $prefix argument is currently ignored if the $display argument is false.
See http://core.trac.wordpress.org/ticket/16632

$display
(bool) (optional) Whether to display or retrieve title
Default: true

Return Values

(string) 
Title when retrieving, null when displaying or failure.

Examples

Display the Custom Post Type title:

<h1><?php post_type_archive_title(); ?></h1>

Notes

Change Log

Source File

post_type_archive_title() is located in wp-includes/general-template.php.

Related

Post Types: register_post_type(), add_post_type_support(), remove_post_type_support(), post_type_supports(), post_type_exists(), set_post_type(), get_post_type(), get_post_types(), get_post_type_object(), get_post_type_capabilities(), get_post_type_labels(), is_post_type_hierarchical(), is_post_type_archive(), post_type_archive_title()

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