0

I have some image file in my plugin directory. I want to display those file by using my theme function. I am trying many way but something was wrong. Theme and plugin both dir is loaded at same time.

Can you help me?

    $link = plugins_url( 'img/btn-arrow-left.png',__FILE__ );
    //$link = plugin_dir_url( 'img/btn-arrow-left.png',__FILE__ );
    $aro_left = '<img src="'.$link.'img/btn-arrow-left.png"/>';
    var_dump($link);

Output :

string 'http://localhost/project/wp-content/plugins/C:/wamp/www/project/wp-content/themes/Buddhist/img/btn-arrow-left.png' (length=113)
0

You are almost there. Try plugins_url('plugin_dir_name/img/name of.png').

  • I'll get no points but he was helped I assure you all! – Nathan Powell Sep 11 '16 at 8:45

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.