WordPress.org

Ready to get started?Download WordPress

Forums

require_once doesn't work (3 posts)

  1. jgas
    Member
    Posted 5 years ago #

    hi to this big community!

    i have a problem, can you help me?

    inside a template (sidebar.php in my case) when i try to add:

    <?php require_once('whatever');

    and i refresh my page, i can't see anything after the point where i've added the code require once.
    For example, if i add it before the footer, i can't see the footer.
    If i add it in the <head> i can't see the whole page!

    i need it to require simplepie for this blogroll: http://net.tutsplus.com/javascript-ajax/building-a-better-blogroll-dynamic-fun-with-simplepie-and-jquery/

    If you want to give a look to the page i'm tring to code, please visit http://www.cinenotizie.net

    Thank you!

  2. dor
    Member
    Posted 5 years ago #

    Try to specify full path.

  3. Scoe
    Member
    Posted 4 years ago #

    I had this problem. WordPress doesnt seem to like require_once commands, instead, use the include command.

    include(TEMPLATEPATH.'/whatever.php');

    If you have white space after this, try taking out the <?php tag from the included file to see whether it gets entered as text or not. If it does, then the problem lies in the included file, not the include statement.

Topic Closed

This topic has been closed to new replies.

About this Topic