Re: list posts
Posted: Thu Mar 30, 2017 5:30 pm
So, I adjusted it and it still doesn't work...
index.php of the theme :
New file for the theme, php/archives.php :
When I am calling URL/pages/all, I got the 404 default error.
What am I doing wrong?
index.php of the theme :
Code: Select all
<?php
if( ($Url->whereAmI()=='home') || ($Url->whereAmI()=='tag') )
{
include(PATH_THEME_PHP.'home.php');
}
elseif($Url->whereAmI()=='post')
{
include(PATH_THEME_PHP.'post.php');
}
elseif($Url->whereAmI()=='page')
{
include(PATH_THEME_PHP.'page.php');
}
elseif($Url->whereAmI()=='page' && ($Page->title()=='all'))
{
include(PATH_THEME_PHP.'archives.php');
}
?>
Code: Select all
<article class="post">
<!-- Plugins Page Begin -->
<?php Theme::plugins('pageBegin') ?>
<section class="post-header">
<header class="post-title">
<h1><?php echo $Page->title() ?></h1>
</header>
</section>
<section class="post-content">
<?php
$totalPublishedPosts = $dbPosts->numberPost();
$posts = buildPostsForPage(0, $totalPublishedPosts, true, false);
foreach($posts as $Post)
{
echo '<h1><a href="'.$Post->permalink().'">'.$Post->title().'</a></h1>';
}
?>
</section>
<!-- Plugins Page Begin -->
<?php Theme::plugins('pageEnd') ?>
</article>
What am I doing wrong?