
Originally Posted by
baileysemt
As not all of us are coding experts

and are just learning how to do this, could you please take a moment and share exactly
which 4 lines of PHP code would accomplish this?
PHP Code:
//connect to database
mysql_connect("hostname", "username", "password");
mysql_select_db("dbname");
//retrieve and link to 5 most recent published posts
$result = mysql_query("SELECT * FROM wp_posts WHERE post_status = 'publish' ORDER BY post_date DESC LIMIT 5");
while ($row = mysql_fetch_array($result)) {
echo "<a href=\"/blog/?p=" . $row['ID'] . "\">" . $row['post_title'] . "</a>";
}
Bookmarks