Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #29591

    Hi

    I have a folder named “Mega” with a file index.php inside.

    I am trying to add the header and footer of the theme

    (My folder is in the root of the site)

    I tried unsuccessfully several code:

    Code:
    <?php
    include $_SERVER[‘DOCUMENT_ROOT’].”/wp-content/themes/enfold/header.php”;
    ?>

    And

    Code:

    <?php
    require(‘./header.php’);
    include $_SERVER[‘DOCUMENT_ROOT’].”/wp-content/themes/enfold/header.php”;
    ?>

    Can you help me please !!

    Regards,

    #141079

    Hi,

    What are you trying to do? I don’t think this is possible.

    Regards,

    Ismael

    #141080

    Hi,

    You’ll probably get an error (not a 404 one), but this will work:

    include "../wp-content/themes/enfold/header.php";

    Regards,

    Josue

    #141081

    Hey,

    – Ismael : I try to include my php script in the theme enfold.

    – Josue : Can you tell me why it does not work ?

    I have no error just a blank page…

    Regards,

    #141082

    Hi,

    It doesn’t work because it header.php calls a global variable, check your PHP log.

    Regards,

    Josue

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘include header and footer’ is closed to new replies.