1 (edited by stuseattle 25-06-2015 00:32:31)

Topic: Repost: Changing the order by date?

[Sorry to repost so soon . . . thought maybe it should be in this forum instead of the "general" one]

I recently installed Nibbleblog and searched the forum for an answer to this. (Found one but didn't understand how to do it.)

I'd like to change the order of posts so that they go oldest to newest, instead of newest on top.
Someone posted that you could change the $posts array to "reverse" but I couldn't find that in any of the files anywhere and don't know specifically where I might insert it.

Basically, I'd like visitors to read the blog in the order in which it was written.

Can someone help?

stu

Re: Repost: Changing the order by date?

No answers so I started messing around.  For anyone else who would like to order posts as written, as opposed to newest first, here's the solution I used . . . seems stable so far:

Navigated to the installed theme:
Opened folder "templates"
Opened folder "views"
Opened folder "blog"
Edited "view.bit" as follows:

From the start of the file, it WAS:

<?php

// There are no posts
if(empty($posts))
{
    echo '<p>'.$Language->get('there are no posts').'</p>';
}
else
{
    echo '<ul class="index">';
    // Print each post
    foreach($posts as $post)
    {
        // Include the post link for each post

Now it's:

else
{
    echo '<ul class="index">';
    // Print each post
    $posts = array_reverse($posts);
    foreach($posts as $post)
    {
        // Include the post link for each post

Seems to work.