Explorar el Código

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 hace 11 años
padre
commit
bb21f4b13b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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 %}