在wordpress中加载不同的功能文件


loading different function files in wordpress

我在wordpress中制作了两套不同的函数。

一组只影响后端或管理端,另一组影响前端实时站点。

我想在浏览前端网站时只加载前端功能文件(front-functions.php),在浏览管理区域时加载后端(admin-functions.php)文件。

有可能这样做吗?如果是,如何?

请帮忙。

您可以在函数中尝试此代码。php

if ( is_admin() ) {
     include_once('admin-functions.php')
} else {
     include_once('front-functions.php')
}

谨致问候,jhOy