Más averiguaciones. La ID del post reciente la lee de aquí:
/* If there is a post category specified, continue... */
if ($post_category_id) {
if (($post_display == 1) || ($post_display == 4)) {
/* Query the title and excerpt */
$req_post = "SELECT wp_posts.ID, wp_posts.post_title, wp_posts.post_excerpt FROM wp_posts, wp_term_taxonomy, wp_term_relationships WHERE (wp_term_taxonomy.term_id = $post_category_id) AND (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) AND (wp_term_relationships.object_id = wp_posts.ID) AND (wp_posts.post_modified <= '$now') AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.ID DESC LIMIT 1;";
$posts = $wpdb->get_results($req_post);
foreach ($posts as $post) {
$single_post_id = $post->ID;
$single_post_title = $post->post_title;
$single_post = $post->post_excerpt;
}
}
else if (($post_display == 0) || ($post_display == 2) || ($post_display == 3)) {
/* Query the title and content */
$req_post = "SELECT wp_posts.ID, wp_posts.post_title, wp_posts.post_content FROM wp_posts, wp_term_taxonomy, wp_term_relationships WHERE (wp_term_taxonomy.term_id = $post_category_id) AND (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) AND (wp_term_relationships.object_id = wp_posts.ID) AND (wp_posts.post_modified <= '$now') AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.ID DESC LIMIT 1;";
$posts = $wpdb->get_results($req_post);
foreach ($posts as $post) {
$single_post_id = $post->ID;
$single_post_title = $post->post_title;
$single_post = $post->post_content;
}
}
Lo demás es código para que el código de números que hace funcionar al plugin y gestionar als otras opciones funcione...a ver si logro recomponer algo con estos trozos y la estructura general...:S