2018-02-18 20:46:48 +01:00
|
|
|
<?php
|
|
|
|
$GITHUB_BASE_URL = '__GITHUB_BASE_URL__';
|
|
|
|
|
2018-02-20 15:51:07 +01:00
|
|
|
$REDIRECT_PARENT_TO_FIRST_CHILD = true;
|
|
|
|
|
2018-02-18 20:46:48 +01:00
|
|
|
if (!$Site->homepage()) {
|
|
|
|
echo 'This theme need a home page defined, please select one page on <b>Admin panel->Settings->Advanced->Home page</b>';
|
|
|
|
exit;
|
|
|
|
}
|
2018-02-20 15:51:07 +01:00
|
|
|
|
|
|
|
if ($REDIRECT_PARENT_TO_FIRST_CHILD) {
|
|
|
|
if (!empty($page)) {
|
|
|
|
if ($page->isParent() && $page->hasChildren()) {
|
|
|
|
$children = $page->children();
|
|
|
|
if (!empty($children[0])) {
|
|
|
|
$firstChild = $children[0];
|
|
|
|
|
|
|
|
header('Location: '.$firstChild->permalink(), true, 302);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|