WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to display sidebar.php on external site (3 posts)

  1. scooter3k
    Member
    Posted 6 years ago #

    Hi,

    I am trying to integrate wordpress with a previous web site of mine, and I want to display only the sidebar on my home page of the separate website. It would be really easy if i could just add:
    <?php include('THE_DIRECTORY/sidebar.php') ?>
    but then it isn't connected to the mysql database, and probably some more stuff too. What would be the easiest way to do this? or what other includes would I need on that page before I could do that?

    The separate website and wordpress are hosted on the same server, so I can navigate wherever in the wordpress directory.

    Thanks in advance! :)
    -Scott

  2. davey579
    Member
    Posted 6 years ago #

    Try this:

    <?php require('./wp-blog-header.php'); ?>
    <?php get_sidebar(); ?>

    Don't know for sure this will work.

  3. scooter3k
    Member
    Posted 6 years ago #

    woohoo! it worked :) thanks!

    "that was easy!" lol

Topic Closed

This topic has been closed to new replies.

About this Topic