I am storing the SEO title with advanced-custom-fields. How do i set the seo title tag within my single-mypost.php template. This is the place where i can call get_field('title_tag');
I tried adding this to functions.php :
add_filter('wpseo_title', 'filter_product_wpseo_title');
function filter_product_wpseo_title($title) {
if( is_singular( 'my_post_type') ) {
$title = get_field("title_tag");
}
return $title;
}