This is what’s in the functions.php file:
<?php
/*
DESCRIPTION:
Functions to get the Recent Posts and getting the Pages
*/
function CMSTheme_GetRecentPosts($current_id, $limit)
{
global $wpdb;
$posts = $wpdb->get_results("SELECT ID, post_title FROM " . $wpdb->posts . " WHERE post_status='publish' ORDER BY post_date DESC LIMIT " . $limit);
foreach ($posts as $post)
{
$post_title = stripslashes($post->post_title);
$permalink = get_permalink($post->ID);
if ($post->ID != $current_id) echo "<li><a href=\"" . $permalink . "\">" . $post_title . "</a></li>\n";
}
}
function CMSTheme_GetPages($with_content = '')
{
global $wpdb;
$query = "SELECT ID, post_title, post_name FROM " . $wpdb->posts . " WHERE post_type='page' OR post_status='static' ORDER BY menu_order ASC";
if ($with_content == "with_content")
{
$query = "SELECT ID, post_title,post_name, post_content FROM " . $wpdb->posts . " WHERE post_type='page' OR post_status='static' ORDER BY menu_order ASC";
}
return $wpdb->get_results($query);
}
?>