Site icon WP Smith

Remove Post Title and Page Title from Genesis Child Theme (with or without Post Formats Support)

The same function controls the title for posts and pages; however, to remove the title from one or the other is different. As always open the functions.php in your favorite html/text editor or at Appearance > Editor (or in MS, found under Network Admin). Scroll to the bottom of the page and paste the code below into the functions.php file.

Remove Post Title from Posts

To remove all titles from posts, simply add the following:
[php]//REMOVE POST TITLE
remove_action('genesis_post_title', 'genesis_do_post_title');[/php]

With the introduction of Post Formats in WordPress 3.1, depending on its format, you may want to remove the post title. As it currently stands, has_post_format($arg1, $arg2) can only take a string in $arg1 and $arg2 is optional (and is $post_id), and the supported post formats from WordPress 3.1 are: aside, chat, image, link, quote, status, video, audio, and gallery. So to remove post titles from posts with these formats, simply add the following:
[php]if ( has_post_format( 'aside' ) || has_post_format( 'chat' ) || has_post_format( 'image' ) || has_post_format( 'link' ) || has_post_format( 'quote' ) || has_post_format( 'status' ) || has_post_format( 'video' ) || has_post_format( 'audio' ) || has_post_format( 'gallery' ) ) {
remove_action('genesis_post_title', 'genesis_do_post_title');[/php]

Remove Post Title from Pages

To remove page titles from specific pages, simply add the following:
[php]//REMOVE PAGE TITLE
add_action('get_header', 'child_remove_page_titles');
function child_remove_page_titles() {
$pages=array();
if (is_page($pages)) {
remove_action('genesis_post_title', 'genesis_do_post_title');
}
}[/php]

Or, to remove the title from the home page, simply add the following:
[php]//REMOVE PAGE TITLE FROM HOME PAGE
add_action('get_header', 'child_remove_page_titles');
function child_remove_page_titles() {
if (is_home()) {
remove_action('genesis_post_title', 'genesis_do_post_title');
}
}[/php]