Title: Getting the Plugin Directory
Last modified: August 18, 2016

---

# Getting the Plugin Directory

 *  Resolved [golddave](https://wordpress.org/support/users/golddave/)
 * (@golddave)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/getting-the-plugin-directory/)
 * I have a plugin that creates a link in a post. I’d like to add an icon to every
   link. The icon image file will live in the same directory as the plugin. How 
   would I reference this directory programatically for the purpose of writing the
   img src tag?
 * Thanks,
    Dave

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/getting-the-plugin-directory/#post-601840)
 * look at how other plugins handle paths.
 * thats the easiest thing to do.
 *  Thread Starter [golddave](https://wordpress.org/support/users/golddave/)
 * (@golddave)
 * [18 years, 10 months ago](https://wordpress.org/support/topic/getting-the-plugin-directory/#post-601857)
 * OK. I’m an idiot. I can use dirname(__FILE__). I’ve been out of the php game 
   for the last few months and I have to re-learn things that used to be simple 
   to me.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Getting the Plugin Directory’ is closed to new replies.

## Tags

 * [plugin directory](https://wordpress.org/support/topic-tag/plugin-directory/)

 * 2 replies
 * 2 participants
 * Last reply from: [golddave](https://wordpress.org/support/users/golddave/)
 * Last activity: [18 years, 10 months ago](https://wordpress.org/support/topic/getting-the-plugin-directory/#post-601857)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
