I need import css files from a folder in plugin directory to a plugin php file.

I tried

plugin_dir_path( __FILE__ );

<link rel="stylesheet" href="<?php echo __DIR__ . '/dahili/bootstrap.min.css'; ?>">
<link rel="stylesheet" href="./dahili/bootstrap.min.css">

but they gives wrong url.

for example, in my last trying, I get this adress:


but I need this:


how to get true address?

Note: Please dont close my question because of dublicate if you dont give 100% same question because I need real solution, I am not troll.


1 Answer 1


To solve this problem, we must use plugin_dir_url command.

For example:

                    wp_register_style( 'foo-styles',  plugin_dir_url( __FILE__ ) . 'dahili/bootstrap.min.css' );
                    wp_enqueue_style( 'foo-styles' );


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.