Forum

Thread tagged as: Blog

Filtered blog sort order

It's only Wednesday and I'm having one of them weeks... I can't seem to change the sort order of the filtered blog feed on the home page.

Its currently showing the oldest first and I have tried lots of different things but can't fix the issue.

HEEEEEELP!

            <?php
                perch_blog_custom(array(
                    'filter' => 'postDateTime',
                    'match' => 'eqbetween',
                    'category' => array('news-feed'),
                    'template' => 'home-news.html',
                            'sort-order'=>'DESC',
                    'count' => '2',
                ));
            ?>
Stephen Wild

Stephen Wild 3 points

  • 6 years ago

Hi there,

You just need to change the 'filter' => 'postDateTime' to 'sort' => 'postDateTime'

and remove the match as you're not doing a filter on the records you're sorting them

Worked a treat, thanks

            <?php
                perch_blog_custom(array(
                    'sort' => 'postDateTime',
                    'category' => array('news-feed'),
                    'template' => 'home-news.html',
                    'sort-order'=>'DESC',
                    'count' => '2',
                ));
            ?>