Below is a small snippet of code I'm using to hide the "home" and "404" in the blog list page.
Code: Select all
<?php if (wCMS::$currentPage == 'home'): ?> <!-- What page to display the blog posts on (default: home) -->
<?php
foreach ( wCMS::db()->pages as $pageName => $page ): ?>
<?php // Don't display 404 page
if($pageName == '404' || $pageName == "home") { // Don't show the "home" page and "404" page in the blog/page list (default: 404, home)
echo "";
} else { // Display blog title + link and keywords/tags
?>
<div class="paddingLeftRight20">
<h3 class="page-header">
<small> <span class="glyphicon glyphicon-calendar"></span> <?=$page->date; ?></small><br />
<strong class="blue"><a href="<?=$pageName?>"><?=$page->title; ?></a></strong> <!-- Blog post title + link -->
</h3>
<p class="small text-right darkText"><?=$page->keywords; ?></p>
</div>
<?php } endforeach; ?>
<?php endif ?>
Code: Select all
if($pageName == '404' || $pageName == "home") { // Don't show the "home" page and "404" page in the blog/page list (default: 404, home)
echo "";
} else {
// show all other pages/blog
}