-2

Here is the code below. I'm trying to put the default logo using PHP conditions in my wp theme. But it's showing an error. ( Parse error: syntax error, unexpected 'get_template_directory_uri' (T_STRING), expecting ',' or ';' in C:\wamp\www\law\wp-content\themes\digital-pro\header.php on line 64 )

if( has_custom_logo() ){
      the_custom_logo();
   }
   else{
     echo '<img src=" '.get_template_directory_uri().'/img/logo.png" alt="">';
  }

1 Answers1

1

Try it like this..

if( has_custom_logo() ){
   the_custom_logo();
}
else{ ?>
   <img src=" <?php echo get_template_directory_uri(); ?>/img/logo.png"        alt="">
<?php }
Darsh khakhkhar
  • 666
  • 5
  • 15