gpt4 book ai didi

php - Wordpress - Include_once 根文件

转载 作者:可可西里 更新时间:2023-11-01 00:42:37 25 4
gpt4 key购买 nike

<分区>

我试图在我的 Wordpress 站点的 header.php 中包含一些 .php 文件。

这是我的架构:

Root/
|_ includes
|_ db_connect.php
|_ functions.php
|_ var_list.php
|_ wp-includes
|_ wp-content
|_ themes
|_ NameTheme
|_ header.php
|_ wp-admin

我需要在我的 header.php

中包含这些行
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
include_once 'includes/var_list.php';

sec_session_start(); // function to start session, placed in functions.php

我的尝试:

  1. 使用 $_SERVER['DOCUMENT_ROOT']
  2. 使用 dirname(_FILE_)
  3. 使用 ABSPATH//这是在我的 wp-config.php
  4. 上定义的
  5. 使用 home_url
  6. 使用 site_url

全部返回空白页(500内部错误)可以帮帮我吗?谢谢。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com