子目录中的WordPress主题文件

在当前项目中工作, 该项目有特定主题文件的github存储库。当我克隆存储库时, 它将主题文件夹放在一个单独的目录中(例如, 应该放置):

/ wp-content / themes / projectfolder / themefolder

我想知道的是, 是否可以让WordPress在子目录中查找该主题, 而不必将整个git项目移到themess文件夹中, 因为那样会使事情变得一团糟。


#1


在你的wp-config.php文件中, 添加以下内容:

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
register_theme_directory('/wp-content/themes/projectfolder');

通常是register_theme_directory();函数用于在插件内定义主题文件夹, 但是, 在此之外还有一些很好的用例。

来源:

https://www.srcmini02.com/64537.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37426.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?