• I’m writing a plugin. The following code works.

    $XYZ_path = ABSPATH.’wp-content/plugins/xyz/style/xyz.css’;

    I would like to make it so it defines the path without using ABSPATH, where it locates the path by the plugin directory.

    I have tried using:

    $XYZ_path = plugin_dir_url( __FILE__ ) . ‘style/xyz.css’;

    This does not work.

    Any suggestions?

    Any help would be greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Outdoorsmen,

    Does

    $XYZ_path = plugin_dir_path( __FILE__ ); echo $XYZ_path;

    return the expected path?

    Thread Starter Outdoorsmen

    (@outdoorsmen)

    @schulte

    I appreciate your quick response.

    I’m not sure why I didn’t think of that. Duh!

    plugin_dir_path did not work but plugin_dir_url does.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Path Question’ is closed to new replies.