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

paths - Including $_SERVER['DOCUMENT_ROOT'] to load files outside of wordpress installation doesn't work

programmeradmin1浏览0评论

I have built a wordpress site locally in a directory /blog I have other site files that are at the web root that I need to access in the WordPress installation, css, js etc.

Locally I included the files by:

<style>
<?php include($_SERVER['DOCUMENT_ROOT'] . 'css/site-style.css'); ?> 
</style>

For reasons out of my control we inject the styles into the head instead of wp_enqueue_styles.. I know gross

This worked fine locally, but now that I have deployed the files remotely it no longer works. If I echo the path out I receive the proper file path. Is there a function or way so that I can access the files both locally and remotely outside of the wordpress installation?

thanks for your help!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论