Skip to content

Instantly share code, notes, and snippets.

@hsleonis
Created March 20, 2016 11:41
Show Gist options
  • Save hsleonis/e939c2b76ad7679f1e9e to your computer and use it in GitHub Desktop.
Save hsleonis/e939c2b76ad7679f1e9e to your computer and use it in GitHub Desktop.
Display the Custom Post Type title
<?php
/*
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
$display
(bool) (optional) Whether to display or retrieve title
Default: true
Return Values
(string) Title when retrieving, null when displaying or failure.
*/
post_type_archive_title();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment