[resolved] Adding header,footer and side widgets to custom php page (6 posts)

  1. Morsus
    Posted 4 years ago #

    I manage to do this with SMF and PHPBB forums but i cant do it with wordpress..I know it could be possible,so anyone can help me out?

    For those who didn't understand my problem.
    I have an php page that has nothing to do with wordpress files,i want it to have the same header,footer and side widgets..

  2. patv
    Posted 4 years ago #

    Using header and footer (and side widgets too i suppose) means two things: you need a mean to include them in your main file and the libraries loaded up in order to call the WP functions correctly. For your page to call the WP function your file needs to remain in the scope of WordPress as far as I know, so you're very limited in terms of which directory to store them in.

    As far as including the files themselves, you can simply perform a PHP include on them.

  3. Morsus
    Posted 4 years ago #

    I can store that php file anywhere,just tell me witch files i need to include and in witch order.thanks :D

  4. patv
    Posted 4 years ago #

    It's not that easy, you're attempting to pull in the whole WordPress installation in session. I have no idea what files you'd need to include. You're best bet is to save these files within the WordPress scope so you can call their functions directly.

  5. Morsus
    Posted 4 years ago #

    WordPress scope?

  6. Morsus
    Posted 4 years ago #

    Got it,for anyone who wants to do the same this just add this code on the beginning of your file:


    And this on the end:

    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.