I’m trying to include the post title in a custom post type edit screen. For example if the post is called Biography, I want the edit page title to be ‘Edit Biography’. I’m using the below code:
function my_post_register() {
$mypagetitle = $post->post_title;
$labels = array(
'edit_item' => __('Edit '.$mypagetitle),
Why isn’t this displaying the post title?
This will do it:
two things I’d suggest. First try adding global $post as the first line in your function
Also in places I’ve had trouble getting the post_title, then I found another function
You could try that – more details: http://codex.wordpress.org/Function_Reference/single_post_title