Skip to content

Instantly share code, notes, and snippets.

@lukeholder
Last active August 27, 2016 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeholder/6127558 to your computer and use it in GitHub Desktop.
Save lukeholder/6127558 to your computer and use it in GitHub Desktop.
{% set username = craft.request.getSegment(3) %}
{% set author = craft.users.username(username).first() %}
<p>Articles written by <strong>{{ author.firstName }} {{ author.lastName }}</strong></p>
{% paginate craft.entries.section('blog').limit(5).authorId(author.id) as entries %}
{% for entry in entries %}
<article>
<h1><a href="{{ entry.url }}">{{ entry.title }}</a></h1>
<div class="meta">
<span class="date">{{ entry.postDate|date("F d, Y") }}</span> |
<a href="">{{ entry.author }}</a>
</div>
{{ entry.body }}
</article>
{% endfor %}
<div class="article-pagination">
{% if paginate.prevUrl %}
<a href="{{ paginate.prevUrl }}" class="newer ss-navigateleft">Newer Articles</a>
{% endif %}
{% if paginate.nextUrl %}
<a href="{{ paginate.nextUrl }}" class="older ss-navigateright right">Older Articles</a>
{% endif %}
</div>
{% endpaginate %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment