Codex

Template Tags/get the title

Contents

Description

Pass this function a post id and it will return the title of the post. If the post is protected or private, this will be noted by the words "Protected: " or "Private: " prepended to the title.

Usage

 <?php echo get_the_title(ID?> 

Example

Simple breadcrumb trail for pages, two levels deep.


<div class='breadcrumb'>
<?php 
// if there is a parent, display the link
$parent_title get_the_title($post->post_parent);
if(
$parent_title != the_title(,
,false)) { 
  echo (
'<a href=\"' get_permalink($post->post_parent)
    . 
'\" title=\"' $parent_title '\">' $parent_title
    
'</a> &raquo; '); } 
// then go on to the current page link
?>
<a href='<?php the_permalink() ?>'
rel='bookmark' title='<?php the_title(); ?>'>
<?php the_title(); ?></a> &raquo;
</div>


Values

$post->post_status 
$post->comment_status 
$post->ping_status 
$post->post_pingback 
$post->post_category 
$post->post_content 
$post->post_title 
$post->post_excerpt 
$post->page_template 
$post->post_parent 
$post->menu_order 

Related

the_ID, the_title, the_title_attribute, single_post_title, the_title_rss, the_content, the_content_rss, the_excerpt, the_excerpt_rss, wp_link_pages, next_post_link, next_posts_link, previous_post_link, previous_posts_link, posts_nav_link, sticky_class, the_meta

See also index of Function Reference and index of Template Tags.
This page is marked as incomplete. You can help Codex by expanding it.