Support » Fixing WordPress » php include in sidebar.php

  • Hi,

    I have my wordpress blog installed on I need to access some functions in in my sidebar.php file.

    However if I <?php include(‘’)?> all it does is write the code in the included file to the page as text.

    Is it possible to include an external php file in sidebar.php? if so how/where do I do it?

    Thanks and sorry if this is a daft question as this is my first wordpress site. I found this post but it didn’t work either

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi


    Forum Moderator

    Try using:

    <?php include($_SERVER['DOCUMENT_ROOT'] . '')?>

    thanks but that has the same affect. I don’t understand why it is just writing the php to the screen.

    drop the

    I’m guessing your root folder is /

    So just use include_once(‘functions/filename.php’)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘php include in sidebar.php’ is closed to new replies.