For a new theme, i make a function to get a single page.
But Bludit have a tip to get without function a page or post?
My function:
Code: Select all
/**
* Get a page with slug
*
* @param name, title
*
* @return name, title
*/
function getPage($name, $title=false)
{
global $Page, $pagesParents;
foreach($pagesParents as $parentKey=>$pageList)
{
foreach($pageList as $Page)
{
if ($Page->slug()!=$name)
echo 'No page to display!';
else if ($Page->slug()==$name && $title)
echo '<h1>' .$Page->title(). '</h1>' .$Page->contentRaw(true);
else
echo $Page->contentRaw(true);
break;
}
}
}