All
Many thanks for your help. Here's a code snippet of what I went for in the end.
Andy
Many thanks for your help. Here's a code snippet of what I went for in the end.
Andy
PHP Code:
if (return_page_slug() == 'blog') {
$submenu=getChildren('blog'); // change to $id for current page
$menuArray=array();
foreach ($submenu as $menuitem){
$menuArray[(string)$menuitem]['date']=substr(returnPageField($menuitem,'url'), 0, 10);
$menuArray[(string)$menuitem]['title']=returnPageField($menuitem,'title');
$menuArray[(string)$menuitem]['url']=returnPageField($menuitem,'url');
$menuArray[(string)$menuitem]['description']=returnPageField($menuitem,'metad');
} //foreach
//Sort the array in DESC order with the date of the blog
arsort($menuArray);
foreach ($menuArray as $value)
{
$strBlogTitle = $value['title'];
$strBlogURL = $value['url'];
$strBlogDate = date('d M Y', strtotime($value['date']));
$strBlogDescription = $value['description'];
echo "<div class='post'><h2><a href=" . $strBlogURL . ">" . $strBlogTitle . "</a></h2></div>";
// All remaining echos removed as not relevant to all
}
} //if
?>