0
<img alt="Capital" data-inject-svg src="<?php bloginfo( 'template_url' ); ?>/assets/img/logos/imglogo.svg">
<img alt="Capital" data-inject-svg src="<?php echo get_template_directory_uri(); ?>/assets/img/logos/imglogo.svg">

i tried both of above code but don't get output

1
  • The image doesn’t appear, or the URL is missing? Apr 13 '20 at 7:17
0

remove "data-inject-svg" or use data="data-inject-svg" ...work great ...hire a screenshots

Result img

Code img

-1

the answer ;) is :

<img alt="Capital" data-inject-svg src="<?php bloginfo( 'template_url' )."/assets/img/logos/imglogo.svg"; ?>"> 
2
  • This is basically exactly the same as the code in the question that isn't working. Apr 13 '20 at 12:57
  • look again... its work fine... Apr 13 '20 at 13:19
-1

I hope it will your help

Firstly you need to create folder inside the activate theme like this: assets > img > logos > imglogo.svg

If you are working on the child theme can use this:

<img alt="Capital" data-inject-svg src="<?php echo get_stylesheet_directory_uri(); ?>/assets/img/logos/imglogo.svg">

Otherwise you can use this:

<img alt="Capital" data-inject-svg src="<?php echo bloginfo( 'template_url' ); ?>/assets/img/logos/imglogo.svg">

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.