我有一个具有以下目录结构的可湿性粉剂网站。目录结构:
themes
|-parent-theme
| |-index.php
| |-some-footer.php
|
|-parent-theme-child
|-some-footer.php父主题目录包含一堆php文件,index.php就是其中之一。
index.php文件使用(包括)了一些-footer.php。
<?php include('some_footer.php'); ?>我试图通过创建一个完全相同名称的文件来覆盖这个some-footer.php,但它不起作用。
我应该怎么做才能让它工作呢?
发布于 2016-06-04 14:23:17
由于它位于子主题中,请尝试使用get_stylesheet_directory_uri();
<?php include( get_stylesheet_directory_uri() . '/some_footer.php'); ?>https://stackoverflow.com/questions/37626836
复制相似问题