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

  1. scooter3k
    Posted 7 years ago #


    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! :)

  2. davey579
    Posted 7 years ago #

    Try this:

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

    Don't know for sure this will work.

  3. scooter3k
    Posted 7 years ago #

    woohoo! it worked :) thanks!

    "that was easy!" lol

Topic Closed

This topic has been closed to new replies.

About this Topic