Display only published pages in header menu

Dignajar fixed bug where header menu was including draft pages as well. This will only allow pages with published status to be listed in the menu.
This commit is contained in:
Jeremy Monroe 2016-05-28 09:17:24 -05:00
parent a77e22d93b
commit 07faf20234

View File

@ -26,6 +26,9 @@ MIT license
<?php <?php
$parents = $pagesParents[NO_PARENT_CHAR]; $parents = $pagesParents[NO_PARENT_CHAR];
foreach($parents as $Parent) { foreach($parents as $Parent) {
// Check if the parent is published
if( $Parent->published() )
{
echo '<li><a href="'.$Parent->permalink().'">'.$Parent->title().'</a></li>'; echo '<li><a href="'.$Parent->permalink().'">'.$Parent->title().'</a></li>';
} }
?> ?>