<?php if ( function_exists( 'the_custom_logo' ) ) { 
    if(has_custom_logo()) { ?>
        <div class="site-logo">
            <?php the_custom_logo(); ?>
        </div>
    <?php } else {
        if(display_header_text() == true) { ?>
        <div class="site-logo">
            <a href="<?php echo home_url(); ?>" class="title"><?php bloginfo('name'); ?></a>
        </div>
        <?php }
    } 
} ?>