get_title wordpress code example
Example 1: wordpress echo the page title
<?php echo get_the_title(post->$ID); ?>
Example 2: get post title by post id wordpress
get_post( $post_id )->post_title
Example 3: wordpress get site title
You are not outputting anything to show. You are only assigning blog name to a variable. You need to echo the content. It should be :
<h1><?php echo get_bloginfo( 'name' ); ?></h1>
Hope this helps :)