wp-config.php eklemenize gerek yok. Direk mysql_query kullanarak veri çekebilirsiniz.

Database'e bağlantıktan sonra şu sorguyu çalıştırın;

"SELECT * FROM wp_posts WHERE post_type = 'published' ORDER BY post_date DESC LIMIT 5"

Bu sorgudan aldığınız veriyi while döngüsü içerisinde html kodu oluşturun.

Gerekli kod;

<?php
$son_konular = mysql_query("SELECT * FROM wp_posts WHERE post_type = 'published' ORDER BY post_date DESC LIMIT 5");

$html = "";
while ($post = mysql_fetch_assoc($son_konular)) {
    $id = $post['ID'];
    $baslik = $post['post_title'];
    $html .= "<a href='index.php?{$id}'>{$baslik}</a>"; // wordpress url'sine göre yeni düzenleyin.
}

echo $html;
?>