• Resolved evenstar00

    (@evenstar00)


    Hello everyone, I’m trying to include a file that is located in my wp-content directory. I’m trying to include it in index.php that is located in wp-content/themes/mytheme/index.php and I can’t figure out how to include it. This is what I currently have:

    <?php include(TEMPLATEPATH . "/wp-content/Temp_Engine.php"); ?>

    But the system thinks that the file is in /wp-content/themes/mytheme/wp-content/Temp_Engine.php

    and gives me an error. Anyone knows how to fix this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • fix the path ..

    <?php include(TEMPLATEPATH . "../Temp_Engine.php"); ?>

    Thread Starter evenstar00

    (@evenstar00)

    I tried that already, but it gives me this error:

    Warning: main(/home/***/public_html/themes/wp-content/themes/mytheme../Temp_Engine.php) [function.main]: failed to open stream: No such file or directory…

    Thank you though.

    oops, yeah thats my mistake – try this instead:
    <?php include($_SERVER["DOCUMENT_ROOT"]."/wp-content/Temp_Engine.php");?>

    Thread Starter evenstar00

    (@evenstar00)

    Thank you! It’s not throwing any errors anymore, but it won’t show on the page. lol

    Anyway, the issue is solved now though. I’ll see what’s wrong with the file. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to include a file from wp-content’ is closed to new replies.