I have image file stored inside theme directory called site.

Now in my home page using wordpress page editor I have put the following code but it didn’t display image, seems location is wrong.

<img src="https://wordpress.stackexchange.com/questions/252559/site/images/footLogo.png" style="padding: 0px!important; color:white">

let me know what issue?

4 s
4

You can define constant in theme function file as:

if( !defined(THEME_IMG_PATH)){
   define( 'THEME_IMG_PATH', get_stylesheet_directory_uri() . '/site/images' );
  }

and then you can use img tag as

 <img src="https://wordpress.stackexchange.com/questions/252559/<?php echo THEME_IMG_PATH; ?>/footLogo.png" style="padding: 0px!important; color:white">

Leave a Reply

Your email address will not be published. Required fields are marked *