-2

Here is code below. I'm trying to put default logo using php conditions in my wp theme. But it's showing 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="">';
}
Bhumi Shah
  • 8,909
  • 7
  • 57
  • 96

1 Answers1

0

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
  • 621
  • 5
  • 15