• Resolved NathanielElliott

    (@nathanielelliott)


    In essence, I am building a directory to show off Augmented Reality Code but need to make it a separate directory right at the “root” level. The directory will be located at http://domainname.com/ar/ar_home.php. I would like to pull the header into this ar_home.php file but can not figure out how to get that to work. Any ideas on how to facilitate this occurring? Thanks so much.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter NathanielElliott

    (@nathanielelliott)

    I tried including both of those in the header and nothing occurred, the .php page is still coming up empty.

    http://deliberatelyrich.com/ar/ar_home.php

    Any ideas on how I am messing this up? I want to simply pull the http://deliberatelyrich.com header / footer and that is all. Thanks again for doing this so fast.

    Thread Starter NathanielElliott

    (@nathanielelliott)

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    
    <body>
    <?php
    require('/../wp-blog-header.php');
    ?>

    That is what my code looks like at the moment, any ideas?

    what folder is wordpress installed in?

    Thread Starter NathanielElliott

    (@nathanielelliott)

    The root… The website is built completely with it so everything is in the httpdocs directory / root directory for those going to the site. It looks like:

    – WordPress Directory
    = AR Directory
    = wp-content Directory
    = wp-admin Directory
    = wp-includes Directory
    = etc

    Thread Starter NathanielElliott

    (@nathanielelliott)

    That didn’t come out correctly, here we go again…

    WordPress is the whole site and in the root. Then there is:
    /ar
    /wp-content
    /wp-admin
    /wp-includes

    And, I need to go from a .php file in the /ar/ directory and pull the header from wordpress.

    try this:

    <?php
    define('WP_USE_THEMES', false);
    require('./wp-blog-header.php');
    ?>

    Thread Starter NathanielElliott

    (@nathanielelliott)

    That didn’t seem to work. It is posted that way right now on the website. Would I have to pull it from the theme and/or add it to the loop? Or, am I simply missing something?

    Link: http://delibereatelyrich.com/ar/ar_home.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    
    <body>
    
    <?php
    define('WP_USE_THEMES', false);
    require('./wp-blog-header.php');
    ?>
    
    </body>
    </html>
    Thread Starter NathanielElliott

    (@nathanielelliott)

    Is there something in the code that is messing this up or any other ideas?

    the code you have above doesn’t actually display anything…. it just loads the Wp environment

    on my site I have the php require block of code inside the head section

    Anyway, once that is in there do you do anything?

    Like use any template tags to call wp stuff?

    Also a problem I can see, you have a doctype and stuff in that file. Which is important. But if you manage to call over WPs header, it also has that stuff….

    Thread Starter NathanielElliott

    (@nathanielelliott)

    I see what you mean. Here is what I am looking to do and am not sure how other then the code you see above. I want to pull the header and footer of my theme called “Magazeen” into this directory / php file. In essence, I want the header / footer to be the same as http://deliberatelyrich.com on this ar_home.php file.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Pulling the header.php into a separate directory’ is closed to new replies.