Hide static page in menu

Post Reply
xanmean
Jr. Bludit
Posts: 5
Joined: Tue Jan 29, 2019 7:14 pm

Wed Jan 30, 2019 5:18 pm

I create static page 404, how i can hide it in menu. Thank you.

Code: Select all

<?php foreach ($staticContent as $staticPage): ?>
	<li>
	<a href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
	</li>
<?php endforeach ?>
xanmean
Jr. Bludit
Posts: 5
Joined: Tue Jan 29, 2019 7:14 pm

Wed Jan 30, 2019 7:28 pm

I don't know php but i do this

Code: Select all

<?php foreach ($staticContent as $staticPage): ?>
<?php if($staticPage->slug() != '404'){ ?>
<li>
<a href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
<?php } ?>
</li><?php endforeach ?>
User avatar
Edi
Site Admin
Posts: 1567
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed Jan 30, 2019 10:05 pm

Yes, this should work.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Post Reply