How to call images from your plugins image folder?

Use plugin_dir_url() to get the public URI for the directory where the calling PHP file is. <img src=”<?php echo plugin_dir_url( __FILE__ ) . ‘images/facebook.png’; ?>”> If the PHP file is in a sub directory of your plugin you have to go up: <img src=”<?php echo plugin_dir_url( dirname( __FILE__ ) ) . ‘images/facebook.png’; ?>”>

Published
Categorized as [WP] Plugins