Hello,
I am using a custom query to get te latest updated pages. Problem is,however, it also includes parent pages. I would like it only displays the lowest-level pages (with no children). How to?
The code:
<?php
$today = current_time('mysql', 1);
$howMany = 8; //Number of posts you want to display
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT $howMany")):
?>
<?php
foreach ($recentposts as $post) {
if ($post->post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID);?>
The website: http://www.scheepvaartinbeeld.nl/
The code runs the Updates and Nieuwste schepen on the homepage.