The first thing that i am not getting is $exclusive->y ? can you please share custom field settings that you have created?
And the second thing that i have found, you must have to put global $post; in the first line of the function :
add_filter( 'the_title', 'wpb_new_title', 10, 2 );
function wpb_new_title( $title, $id ) {
global $post;
if('post' == get_post_type($id)){
$exclusive = get_field('exclusive', $id); // pass the id into get_field
$title = $title .', ' . $exclusive;
}
return $title;
}
I have added a title on the default post. see the screenshot of the settings and the view page.
in viewpage my post name is Hello World and i am adding “,test additional title” from the filter hook.
Please check, If it works for you. also please share the details that i have mentioned.
Thanks!:)