• Hello everyone, I’ve been debugging this for hours now, and I think I just need some help from someone that is more experienced with directory coding than myself. I get the following warnings:

    Warning: require_once(./admin-header.php) [function.require-once]: failed to open stream: No such file or directory in /home/mjmfxcom/public_html/xsv/wp-admin/themes.php on line 57

    Fatal error: require_once() [function.require]: Failed opening required ‘./admin-header.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/mjmfxcom/public_html/xsv/wp-admin/themes.php on line 57

    If I remove the ‘./’ from the includes it’s kosher again.

    Basically what I’ve done is write a function that automatically registers and enques stylesheets and js files so I don’t have to do it manually for every theme I write. Here’s that function:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I’m 99% sure it’s because I’ve left the working directory as something it’s not supposed to be, but my understanding was that closedir() reset the working directory. Should I set it to the root WP directory rather than just closing it?

    Also, the function is rough by all means, but if you spot ways to improve it I’m all ears ;).

  • The topic ‘PHP working directory, WordPress issues’ is closed to new replies.