0
            <?php if ( get_theme_mod( 'fukasawa_logo' ) ) : ?>

            <a class="blog-logo" href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'title' ) ); ?> &mdash; <?php echo esc_attr( get_bloginfo( 'description' ) ); ?>' rel='home'>
                <img src='<?php echo esc_url( get_theme_mod( 'fukasawa_logo' ) ); ?>' alt='<?php echo esc_attr( get_bloginfo( 'title' ) ); ?>'>
            </a>

        <?php elseif ( get_bloginfo( 'description' ) || get_bloginfo( 'title' ) ) : 

            // h1 on singular, h2 elsewhere
            $title_type = is_singular() ? '2' : '1'; ?>

            <h<?php echo $title_type; ?> class="blog-title">
                <a href="<?php echo esc_url( home_url() ); ?>" title="<?php echo esc_attr( get_bloginfo( 'title' ) ); ?> &mdash; <?php echo esc_attr( get_bloginfo( 'description' ) ); ?>" rel="home"><?php echo esc_attr( get_bloginfo( 'title' ) ); ?></a>
            </h<?php echo $title_type; ?>>

        <?php endif; ?>

How can I remove the "check for image logo" part? I only want to use text logo.

3
  • 1
    I don't understand. Why not just not set a logo? Or just remove the conditional tag? There must be context here I'm not getting. Mar 28, 2018 at 13:05
  • Create a child theme, which will require a style.css file with comments defining it as a child theme, and a copy of this file - just remove the lines of code you don't want.
    – WebElaine
    Mar 28, 2018 at 13:05
  • @JacobPeattie I just wanted to remove unnecessary code, calls, etc. Why have that if I will never use the image logo option?
    – Ciprian
    Mar 28, 2018 at 14:28

1 Answer 1

1

You need to create a child theme. You can use a plugin to do that, just search for 'child theme' on the wordpress plugins search.

After that, you need to copy your header.php to the child theme directory.

Then, you need to change the code above to the following:

  <?php if ( get_bloginfo( 'description' ) || get_bloginfo( 'title' ) ) : 
        // h1 on singular, h2 elsewhere
        $title_type = is_singular() ? '2' : '1'; ?>
        <h<?php echo $title_type; ?> class="blog-title">
            <a href="<?php echo esc_url( home_url() ); ?>" title="<?php echo esc_attr( get_bloginfo( 'title' ) ); ?> &mdash; <?php echo esc_attr( get_bloginfo( 'description' ) ); ?>" rel="home"><?php echo esc_attr( get_bloginfo( 'title' ) ); ?></a>
        </h<?php echo $title_type; ?>>
    <?php endif; ?>

(Just remove the part that checks if an image has been set)

That way, you can update your theme and you won't loose that change.

2
  • I don't want to use child theme but your answer is the solution, works just fine.
    – Ciprian
    Mar 28, 2018 at 14:25
  • You can do the same thing in the main theme, you will just loose that if you ever update it. Glad to help =) Mar 28, 2018 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.