WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a sql database of historical events, I would like it to post data into the sidebar area of a wordpress site. As I am very new to it I do not have any idea how to proceed. I would be thankful if anyone could help me out. Thanks in advance

share|improve this question
up vote 4 down vote accepted

You can edit the sidebar.php (or any sidebar-xxx.php file, depends on your theme) and interface with your database using the wpdb class.

If your historical events are in the same DB as wordpress you can use the wpdb class straight away, if they are in another DB you can instanciate a new wpdb class with :

$my_db = new wpdb('user','pass','dbname','host');
share|improve this answer
You don't actually need the $wpdb global in that case. – scribu Jun 29 '11 at 17:00
@scribu, oops, updated. – mike23 Jun 29 '11 at 17:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.