Nimm' einfach wpdb, dann brauchst du dich um den Aufbau der Verbindung nicht kümmern.
Mal ein Themenfremdes Beispiel:
PHP-Code:
<?php $comments = $wpdb->get_results("SELECT comment_post_ID, comment_author, comment_author_email, comment_content, comment_date, DATE_FORMAT(comment_date,'%d.%m.%Y %H:%i') AS new_comment_date
FROM $wpdb->comments
WHERE comment_type = ''
&& comment_approved = '1'
ORDER BY comment_date
DESC LIMIT 3"); ?>