By default, the placeholder for the title field of all post types will be same. You can change default ‘Enter Title Here’ for custom post types.
Instructions: Add the following code to the functions.php of your WordPress theme.
You’ll need to update the POST_TYPE
name and default text in the code below.
function change_default_title( $title ){ $screen = get_current_screen(); if ( 'POST_TYPE' == $screen->post_type ) { $title = 'Enter Invoice Title'; } return $title; } add_filter( 'enter_title_here', 'change_default_title' );
You may also enjoy modifying custom post types in WordPress.
This doesnt seem to work (WP 3.8)
hello
how can i set one title for each post type i have? tx a lot!
add_filter(‘enter_title_here’, ‘my_title_place_holder’ , 20 , 2 );
function my_title_place_holder($title , $post){
if( $post->post_type == ‘portfolio’ ){
$my_title = “Add new Portfolio”;
return $my_title;
}
return $title;
}
[…] man in that camp is Kevin Chard from WPSnipp; he’s just doing it to help people out. For developers, you obviously can’t miss the […]