【问题标题】:include_once failed to open stream: No such file or directory - Wordpress [duplicate]include_once 无法打开流:没有这样的文件或目录-Wordpress [重复]
【发布时间】:2017-03-01 06:57:04
【问题描述】:

只是一个新手问题,但我不知道如何处理这个错误。

http://mobitel.esy.es/

警告: include_once(/home/u320415047/public_html/wp-content/themes/thestore/lib/thestore-metaboxes.php): 无法打开流:中没有这样的文件或目录 /home/u320415047/public_html/wp-content/themes/thestore/functions.php 8号线

警告:include_once():打开失败 '/home/u320415047/public_html/wp-content/themes/thestore/lib/thestore-metaboxes.php' 用于包含 (include_path='.:/opt/php-5.5/pear') /home/u320415047/public_html/wp-content/themes/thestore/functions.php 8号线

警告: include_once(/home/u320415047/public_html/wp-content/themes/thestore/lib/custom-config.php): 无法打开流:中没有这样的文件或目录 /home/u320415047/public_html/wp-content/themes/thestore/functions.php 在第 9 行

警告:include_once():打开失败 '/home/u320415047/public_html/wp-content/themes/thestore/lib/custom-config.php' 用于包含 (include_path='.:/opt/php-5.5/pear') /home/u320415047/public_html/wp-content/themes/thestore/functions.php 在第 9 行

【问题讨论】:

    标签: php wordpress .htaccess magento


    【解决方案1】:

    您的部分主题似乎已损坏或未正确上传。它告诉您您缺少一些它试图包含的文件:

    • wp-content/themes/thestore/lib/custom-config.php
    • wp-content/themes/thestore/lib/thestore-metaboxes.php

    仔细检查这些文件是否存在,如果没有,请尝试重新安装您的主题

    【讨论】:

    • 会做先生 :) 谢谢
    • 这解决了我的问题,谢谢:)
    【解决方案2】:

    在 wordpress 中,当您在 functions.php 中包含文件时,您必须使用内置的 get_template_directory() 函数引用正确的文件路径

    include( get_template_directory() .'/file.php' );
    

    【讨论】:

      猜你喜欢
      • 2018-08-30
      • 2018-03-26
      • 2022-10-16
      • 1970-01-01
      • 2011-12-09
      • 2016-07-10
      • 2015-11-14
      • 2016-06-05
      • 2017-05-04
      相关资源
      最近更新 更多