Page 1 of 1
Hide static page in menu
Posted: Wed Jan 30, 2019 5:18 pm
by xanmean
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 ?>
Re: Hide static page in menu
Posted: Wed Jan 30, 2019 7:28 pm
by xanmean
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 ?>
Re: Hide static page in menu
Posted: Wed Jan 30, 2019 10:05 pm
by Edi
Yes, this should work.
Re: Hide static page in menu
Posted: Sun Jan 05, 2020 5:21 pm
by mogh
Where do I have to put this code snippet ?
Into one of the many PHP files of the page or into a field on the admin page ?
Re: Hide static page in menu
Posted: Sun Jan 05, 2020 5:45 pm
by Edi
mogh wrote: ↑Sun Jan 05, 2020 5:21 pm
Where do I have to put this code snippet ?
Into one of the many PHP files of the page or into a field on the admin page ?
It depends from the theme. Which theme do you use?
Re: Hide static page in menu
Posted: Thu Jan 09, 2020 10:09 pm
by gent
I have the same problem and hope that there will be an option on the "Advanced"-tab to hide a static-page from the menu.
Re: Hide static page in menu
Posted: Thu Jan 09, 2020 11:40 pm
by Edi
At the moment this has to be done manually or with a code snippet.
But you can post a feature request at GitHub:
https://github.com/bludit/bludit/issues