• While removing some tool bar menu items in the functions.php file of my theme, I seem to have broken my site (www.lyriquest.com) and now get the following error:

    Warning: dir(TEMPLATEPATHhome/wp-content/themes/setlist/) [function.dir]: failed to open dir: No such file or directory in /home/content/26/9196326/html/wp-includes/functions.php on line 100

    Fatal error: Call to a member function read() on a non-object in /home/content/26/9196326/html/wp-includes/functions.php on line 101

    Any assistance would be appreciated.

    ChronicD

Viewing 15 replies - 1 through 15 (of 15 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you access functions.php?

    Thread Starter ChronicD

    (@chronicd)

    Yes. Thanks for your quick response!

    Thread Starter ChronicD

    (@chronicd)

    After receiving an error from a functions.php edit, i went to replace the problem functions.php file with the original from the theme (which has worked before) and may have inadvertently placed it in the wp-includes dir. I’ve made sure the original functions.php is in the theme directory and have tried to delete functions.php from the wp-includes dir but no luck.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What’s line 100 of functions.php?

    Thread Starter ChronicD

    (@chronicd)

    $dir = dir(TEMPLATEPATH.”/”);

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    can you var_dump($dir);exit; and paste here what it outputs?

    Thread Starter ChronicD

    (@chronicd)

    Not quite sure how to execute that. Can you provide how-to?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    For example, on line 100,

    $dir = dir(TEMPLATEPATH."/");     var_dump($dir);exit;

    Thread Starter ChronicD

    (@chronicd)

    OK. Modified file per above, replaced existing file on site, re-downloaded but no dump result. Is there something I need to do to execute the command?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Sorry, on line 100 try;

    var_dump(TEMPLATEPATH."/");exit; $dir = dir(TEMPLATEPATH."/");

    Thread Starter ChronicD

    (@chronicd)

    Here is what I get.

    function get_availableCss(){
    $result = array();
    $dir = dir(TEMPLATEPATH.”/”); var_dump($dir);exit;
    while (false !== ($file = $dir->read())) {
    if(ereg(“\.css”, $file, $r)){
    $result[] = $file;
    }
    }
    $dir->close();
    return $result;
    }

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Does it output anything on the webpage?

    Thread Starter ChronicD

    (@chronicd)

    Not sure if the dump should appear in functions.php file or on the web page after the modified file is loaded. Here is from the file:
    /*
    Get Available CSS
    */
    function get_availableCss(){
    $result = array();
    var_dump(TEMPLATEPATH.”/”);exit; $dir = dir(TEMPLATEPATH.”/”);
    while (false !== ($file = $dir->read())) {
    if(ereg(“\.css”, $file, $r)){
    $result[] = $file;
    }
    }
    $dir->close();
    return $result;
    }

    Here is from the site with the modified file loaded.

    Warning: dir(TEMPLATEPATH/) [function.dir]: failed to open dir: No such file or directory in /home/content/26/9196326/html/wp-includes/functions.php on line 100
    bool(false)

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I’m sorry, I can’t find the solution to this.
    Remove the code I recommended you add.

    I’m sure you’ll receive help from others.

    Thread Starter ChronicD

    (@chronicd)

    Thanks very much Andrew. I appreciate your efforts.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Functions.php File Error’ is closed to new replies.