Title: Plugin Directory Not Set Properly
Last modified: August 22, 2016

---

# Plugin Directory Not Set Properly

 *  [Aaron D. Campbell](https://wordpress.org/support/users/aaroncampbell/)
 * (@aaroncampbell)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/plugin-directory-not-set-properly/)
 * You are using the following code to set your plugin directory (which you use 
   as the base to enqueue js, etc):
    `$yumprint_directory = get_option('siteurl').'/
   wp-content/plugins/' . dirname(plugin_basename(__FILE__))`
 * The problem is that if you use a custom content directory (which I do on pretty
   much all my sites, as do many people, using a setup very similar to [Mark Jaquith’s Skeleton](https://github.com/markjaquith/WordPress-Skeleton))
   then your plugin detects it’s location wrong.
 * WordPress has `plugins_url()` for this and you can replace your code with this
   to fix it (if you have a github repo or anything, I can make a pull request):
   `
   $yumprint_directory = plugins_url( '', __FILE__ );`
 * Additional information:
    [http://codex.wordpress.org/Determining_Plugin_and_Content_Directories](http://codex.wordpress.org/Determining_Plugin_and_Content_Directories)
   [https://developer.wordpress.org/reference/functions/plugins_url/](https://developer.wordpress.org/reference/functions/plugins_url/)
 * [https://wordpress.org/plugins/recipe-card/](https://wordpress.org/plugins/recipe-card/)

The topic ‘Plugin Directory Not Set Properly’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/recipe-card_cfc7c6.svg)
 * [Recipe Card](https://wordpress.org/plugins/recipe-card/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/recipe-card/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/recipe-card/)
 * [Active Topics](https://wordpress.org/support/plugin/recipe-card/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/recipe-card/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/recipe-card/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Aaron D. Campbell](https://wordpress.org/support/users/aaroncampbell/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/plugin-directory-not-set-properly/)
 * Status: not resolved