Use the display_post_states
hook:
function custom_display_post_states( $states, $post ) {
if ( 'Services' === $post->post_title ) {
$post_states['custom-content'] = 'Services Page';
}
return $post_states;
}
add_filter( 'display_post_states', 'custom_display_post_states', 10, 2 );
or you can do by ID
if ( 1 === $post->ID) {
$post_states['custom-content'] = 'Services Page';
}
To check if page has template:
function custom_display_post_states( $states, $post ) {
$template = get_page_template_slug( $post->ID );
if ( $template == 'YOUR_TEMPLATE_FILE' ) {
$states['custom-content'] = 'Services Page';
}
return $states;
}
add_filter( 'display_post_states', 'custom_display_post_states', 10, 2 );