Codex tools: Log in
Contents |
the_title is a filter applied to the post title retrieved from the database, prior to printing on the screen. In some cases (such as when the_title is used), the title can be suppressed by returning a falsey value (e.g. NULL, FALSE or the empty string) from the filter function.
Suppressing the title in templates for all posts in the "blurb" category:
function suppress_if_blurb($title, $id) {
if (in_category('blurb', $id)) {
return '';
}
return $title;
}
add_filter('the_title', 'suppress_if_blurb', 10, 2);
This filter is applied by:
wp-includes/comment.php
wp-includes/general-template.php
wp-includes/link-template.php
wp-includes/nav-menu-template.php
wp-includes/post-template.php