如何在WordPress中退一步

时间:2016-10-20 21:46:30

标签: php wordpress frameworks

我一直在尝试使用'..'(双点)添加当前目录中不存在的文件。

但它显示了complete_url /../ scripts / style.cssstyle.css?ver = 4.6.1'..

 $wp_easy_seo_scripts =plugin_dir_path(__FILE__).'../scripts/style.css';

为什么它在输出中也显示双点..如何解决?

2 个答案:

答案 0 :(得分:1)

为什么不......

where open_time >= '11/1/16' and open_time < '12/1/16'

请记住,目录路径将来自您的www / public_html目录(文档根目录),因此您不需要路径中的那些目录..但是以防万一,如果这样做,它可能会看起来像这样的东西

where
   DATEADD(hh,
      CASE WHEN MONTH(open_time)=1 THEN -5
      ELSE -4
      END
      ,open_time) >= '11/1/16'AND
   DATEADD(hh,
      CASE WHEN MONTH(open_time)=1 THEN -5
      ELSE -4
      END
      ,open_time) < '12/1/16'

答案 1 :(得分:0)

当您使用

完成路径时,您不需要使用..
    plugin_dir_path(__FILE__) it will give you path to your plugin dir

之后你可以添加

  '/scripts/style.css';

所以它变得完全像这样

 $wp_easy_seo_scripts=plugin_dir_path(__FILE__).'/scripts/style.css';

希望这能解决您的问题

谢谢!