how to properly replace logo with text in header

In header.php have a code that insert a logo into the place:

<div class="small-7 medium-4 columns logo<?php if ($header_style == 'style1') { ?> show-for-large-up<?php } ?>">
                <?php if ($header_style == 'style2') { ?>
                    <a href="<?php echo home_url(); ?>" class="logolink">
                        <img src="<?php echo $logo; ?>" class="logoimg" alt="<?php bloginfo('name'); ?>"/>
                    </a>
                <?php } ?>
            </div>

(upper left corner):

In order to have a logotext instead of the png file, I’ve used the following code with no errors in the console but I’m pretty insecure being a noob in php coding. Is this the proper way (incuding the indentation) to have the desired result ?

<div class="small-7 medium-4 columns logo<?php if ($header_style == 'style1') { ?> show-for-large-up<?php } ?>">
                <?php if ($header_style == 'style2') { ?>
                    <a class="logotext" href="<?php echo esc_url( home_url( '/' ) ); ?>"
                    title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
                    rel="home"><?php bloginfo( 'name' ); ?>
                    </a>
                <?php } ?>
            </div>


Source: wordpress

Leave a Reply