Day 19 Dev Notes

Tonight, I created a couple of custom template tags that can be used to display an author link and a category link. These tags first check if the respective options are enabled, and if they are, they return nicely formatted links.

This changes the following code from:

by <a href="{% url "djpress:author_posts" post.author %}" title="View all posts by {{ post.author_display_name }}"> by {% post_author_link post %}
    {{ post.author_display_name }}
</a>

To:

by {% post_author_link post %}

Or for categories, from this:

<a href="{% url 'djpress:category_posts' category.slug %}" class="badge bg-primary">{{ category.name }}</a>

To:

{% post_category_link category "badge bg-primary" %}