I want some someone to help me with showing posts based on category on the index page using django template. I tried this code
<section id="ccr-latest-post-gallery"> {% load blog %} {% get_blog_categories as categories %} {% for c in categories %} <div class="ccr-gallery-ttile"> <span></span> <p>{{ c.name }}</p> </div><!-- .ccr-gallery-ttile --> {% get_recent_posts 5 as recent_posts %} {% if categories %} {% if post %} <ul class="ccr-latest-post"> {% for post in recent_posts %} <li> <div class="ccr-thumbnail"> <img src="{{ STATIC_URL }}app/img/thumbnail1.jpg" alt="Thumbnail 1"> <p><a href="{{ post.get_absolute_url }}">Read More</a></p> </div> <h4><a href="{{ post.get_absolute_url }}" title="Permalink to {{ post.title }}">{{ post.title }}</a></h4> </li> {% endfor %} </ul> <!-- /.ccr-latest-post --> {% else %} <strong>No posts currently in category.</strong> {% endif %} {% else %} The specified category {{ category.name }} does not exist! {% endif %} <section class="bottom-border"> </section> <!-- /#bottom-border --> {% endfor %} </section> <!-- /#ccr-latest-post-gallery --> someone should please help.. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f170c82f-72c0-4743-b678-210e31d1372b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.