Using WordPress header and footer on external page with its own database (3 posts)

  1. k00ij
    Posted 6 years ago #

    I have wordpress installed on my server. The file structure includes a folder "Rant Board" at the same level as "WP-Content". I essentially have a normal wordpress site, but plan to have a top navigation page devoted to a page for users to leave anonymous posts.

    This rant page is actually calls an entirely separate database used to store and retrieve the anonymous postings. All files required for this are included in the "Rant Board" directory (including its own header.php, functions.php, etc).

    The rant board page script works fine until I try to incorporate "wp-blog-header.php" at the top of the index page. I've been told including this is how to get the header and footer from the wordpress install displayed on an external page. It displays the header correctly, but then the rest of the rant board index page is not displayed.

    I believe this is because the wp-blog-header.php calls the wordpress config.php and sets the database connection and directory paths. This would throw the rest of the rant board php code off.

    How would I set the page back to the rant board database settings? Is there a way around wp-blog-header resetting this information? Do you think the issue is elsewhere?

  2. Samuel B

    Posted 6 years ago #

  3. k00ij
    Posted 6 years ago #

    Samboll - thanks, that's a good start, but it's not quite the answer I'm looking for because they don't mention how to reconnect to the other DB.

    Essentially, I have an external site. It has its own database. I want it to have the same header, footer, and sidebar of my wordpress site. I call wp-blog-header.php on the external page, and it then displays the header correctly.

    However, I believe it resets the DB connection to the wordpress site. I need it to be set back to the other DB. Any idea how to do this? Can I avoid the DB connection to the wordpress DB from wp-blog-header? Is there a better way to do this? Any suggestions or advice would be greatly appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic