最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to Access a file that is inside a plugin's dir from the theme's `functions.php` file

programmeradmin3浏览0评论

So basically I am trying to call a stylesheet file from a plugin's directory from the theme's functions.php file as follow:

add_action( 'wp_enqueue_scripts', function() {
  wp_enqueue_style( 'style.min', get_template_directory_uri() . '/wp-content/plugins/path/to/the/file/style.min.css',false,'1','all');
});

I found the previous snippet in this answer here: wp_enqueue_script was called incorrectly

But it is actually trying to find the file in this path: wp-content/themes/theme_name/wp-content/plugins/path/to/the/file/style.min.css?ver=1

Expected Behavior is: wp-content/plugins/path/to/the/file/style.min.css?ver=1

I am trying to do that because in the console the file is missing because the wrong path it's trying to access this path: /ontent/plugins/path/to/the/file/style.min.css?ver=1

so how I could modify this path to the one I want

发布评论

评论列表(0)

  1. 暂无评论