Masked the page 404
- LRAM
- Master Bludit
- Posts: 199
- Joined: Sat Sep 24, 2016 4:02 pm
- Location: France
- Has thanked: 23 times
- Been thanked: 2 times
- Contact:
Hi
on this website
https://sucrepop.com/bludit-3-9-2
I made my own page 404
but it appears on the home page or in the menu if static. I want to hide it, it should only be visible when there's a wrong adress, or a moved page but I can't find how to do it
on this website
https://sucrepop.com/bludit-3-9-2
I made my own page 404
but it appears on the home page or in the menu if static. I want to hide it, it should only be visible when there's a wrong adress, or a moved page but I can't find how to do it
https://sucrepop.com
Candies for the ears
Candies for the ears
Hi,
I going to check, maybe some bug.
But the page selected for 404 should not appear.
I going to check, maybe some bug.
But the page selected for 404 should not appear.
For 404 as a static page (404 as URI) you can find the place where menu is generated, and just add a condidtional statement like:LRAM wrote: ↑Wed Jul 03, 2019 10:15 am Hi
on this website
https://sucrepop.com/bludit-3-9-2
I made my own page 404
but it appears on the home page or in the menu if static. I want to hide it, it should only be visible when there's a wrong adress, or a moved page but I can't find how to do it
Code: Select all
if ($staticPage->slug() != "404") {
// list menu items
}
For B 3.8.0 custom 404 page was never hidden.
Since I use above mentioned conditional in template I have no idea if this was a bug and does occur from this version until newest 3.9.2
- LRAM
- Master Bludit
- Posts: 199
- Joined: Sat Sep 24, 2016 4:02 pm
- Location: France
- Has thanked: 23 times
- Been thanked: 2 times
- Contact:
Thank Jay
In the waiting of the correction of the bug, i will try to insert your code
In the waiting of the correction of the bug, i will try to insert your code
https://sucrepop.com
Candies for the ears
Candies for the ears
- LRAM
- Master Bludit
- Posts: 199
- Joined: Sat Sep 24, 2016 4:02 pm
- Location: France
- Has thanked: 23 times
- Been thanked: 2 times
- Contact:
Well I can't find the right way to do it
i'll wait to Diego's correction
have a good day
i'll wait to Diego's correction
have a good day
https://sucrepop.com
Candies for the ears
Candies for the ears
Set the url of 404 page as "404" if you haven't already done upon page creation.
Edit the navbar.php file located in themes/portfolio/php/ directory
Look for below code:
Code: Select all
<!-- Static pages -->
<?php foreach ($staticContent as $staticPage): ?><li>
<a href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
</li>
<?php endforeach ?>
Code: Select all
<?php foreach ($staticContent as $staticPage): ?>
<?php if ($staticPage->slug() != "404") { // hide 404 error page from menu ?>
<li>
<a href="<?php echo $staticPage->permalink() ?>"><?php echo $staticPage->title() ?></a>
</li>
<?php } ?>
<?php endforeach ?>