Browse Source

Sort articles in the related posts section by date in ascending order

I think ascending is better. This way older article will appear on top
of the list. Recent related articles may already appear in recent posts
section. You need to bubble up older articles.
Talha Mansoor 10 years ago
parent
commit
bb21f4b13b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      templates/_includes/related_posts.html

+ 1 - 1
templates/_includes/related_posts.html

@@ -3,7 +3,7 @@
 <section>
     <h2>{{ RELATED_POSTS_LABEL }}</h2>
 <ul class="related-posts-list">
-{% for related_post in article.related_posts %}
+{% for related_post in article.related_posts|sort(attribute = 'date') %}
     {% set title = related_post.title|striptags %}
     {% set htitle = title %}
     {%if related_post.subtitle %}