«Return to Blog ListCode: Changing Title Fields for Custom Post Types
Nice little function to make the WordPress CMS a little better. Add to theme’s functions.php.
//change title fields
function change_default_title( $title ){
$screen = get_current_screen();
if ( 'news' == $screen->post_type ) {
$title = 'News Title (make it interesting so people will click on it)';
}
if ( 'documents' == $screen->post_type ) {
$title = 'Document Title';
}
if ( 'articles' == $screen->post_type ) {
$title = 'Article Title';
}
if ( 'resources' == $screen->post_type ) {
$title = 'Resource Title';
}
return $title;
}
add_filter( 'enter_title_here', 'change_default_title' );
Tags: Code






