I have dynamic title tag in my wordpress but seo analyst show “No title Tag found error”?

single_post_title only works on single posts, so you are okay using this. First thing you could try is changing “true” to “false” to make the title be returned in the title tag you’ve created. If that doesn’t fix it then try adding an h1 as below (which i don’t think you’ll need).

SEO is also looking for an H1 (title) tag i believe as well. If you enclose your single_post_title in an h1 tag it will eliminate your seo problem together with changing return output to false:

<h1><title> 

<?php if ( is_single() ) {
    single_post_title('', false); 
} else {
    bloginfo('name'); echo " - "; bloginfo('description');
}
?>

</title></h1>

The other option is to just use this:

<title><?php wp_title(''); ?></title>