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:
parent
a77e22d93b
commit
07faf20234
@ -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>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user