Display Category Entries Based on Slug I am trying to display entries based on the last segment in the url and then paginate.

Here's what I have so far but it's not displaying any entries:

{% set categorySlug = craft.request.getLastSegment() %}
  {% set category = craft.categories.slug(categorySlug).first() %}

  {% if category %}

      {% set entries = craft.entries.relatedTo(category).limit(12) %}
      &lt;ul&gt;

      {% paginate entries as entries %}

      {% for entry in entries %}

      {% for block in entry.resource.type('resource') %}

      &lt;li class="summary m-all t-all d-all"&gt;
      &lt;a href="{{ entry.url }}"&gt;
      &lt;article&gt;
      &lt;header class="article-header"&gt;
      &lt;h1&gt;{{ block.resourceTitle }}&lt;/h1&gt;
      &lt;h5&gt;{{ block.resourceAuthors }}&lt;/h5&gt;
      &lt;p&gt;{{ block.resourceSummary }}
      &lt;span class="link"&gt;Read more&lt;/span&gt;
      &lt;/p&gt;
      &lt;/header&gt;
      &lt;/article&gt;
      &lt;/a&gt;
      &lt;/li&gt;
      &lt;hr class="m-all t-all d-all"&gt;

      {% endfor %}

      {% endfor %}

      &lt;/ul&gt;

      {% if paginate.prevUrl %}
          &lt;a href="{{ paginate.prevUrl }}"&gt;Previous&lt;/a&gt;
      {% endif %}

      {% if paginate.nextUrl %}
          &lt;a href="{{ paginate.nextUrl }}"&gt;Next&lt;/a&gt;
      {% endif %}
      {% endpaginate %}

  {% endif %}


Even this simplified version outputs zero entries:

  {% set categorySlug = craft.request.getLastSegment() %}
  {% set category = craft.categories.slug(categorySlug).first() %}

  {% set entries = craft.entries.relatedTo(category) %}

  {# Output them #}
  {% for entry in entries %}
      &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
  {% endfor %}


Any thoughts?
I'm rolling the same thing with 

{% extends 'layouts/_entry_layout' %}
{# sets the name for the css file to be pulled #}
{% set pageType = 'search' %}
{% set catSlug = craft.request.getSegment(2) %}
{% set title = craft.categories.slug(catSlug).first() ~ ' Channel' %}

{% block content %}

&lt;section class="search-results"&gt;

{% paginate craft.entries.relatedTo(category) as entriesOnPage %}


&lt;h1 class="category__title"&gt;{{ category.title }}&lt;/h1&gt;

    {% for entry in entriesOnPage %}
        {% include 'modules/_article_listing' %}
    {% endfor %}

{% include 'inc/_pagination' %}

{% endpaginate %}

&lt;/section&gt;

{% endblock %}


my article listing module contains the usual things like {{ entry.title }} etc

and pagination include is like so:

{% if paginate %}

{% set currentPage = paginate.currentPage %}
{% set startPage = currentPage - 2 %}
{% set endPage = currentPage + 2 %}
{% if query is defined %}
{% set queryString = "?q=" ~ query %}
{% endif %}


{% if paginate.totalPages &gt; 1 %}
&lt;nav class="pagination" role="navigation"&gt;

    &lt;ol class="pagination__list"&gt;

        {% if paginate.prevUrl %}
        &lt;li class="pagination__item"&gt;
            &lt;a class="btn  btn-2  btn-2a" href="{{ paginate.prevUrl }}{% if queryString is defined %}{{ queryString }}{% endif %}"&gt;
                &amp;larr;
                &lt;span class="visuallyhidden"&gt;Previous Page&lt;/span&gt;
            &lt;/a&gt;
        &lt;/li&gt;
        {% endif %}
        {% for i in startPage..endPage %}
        {% if paginate.getPageUrl( i ) %}
        {% if i != currentPage %}

        &lt;li class="pagination__item"&gt;
            &lt;a class="btn  btn-2  btn-2a" href="{{ paginate.getPageUrl( i ) }}{% if queryString is defined %}{{ queryString }}{% endif %}"&gt;
                &lt;span class="visuallyhidden"&gt;Page &lt;/span&gt;{{ i }}
            &lt;/a&gt;
        &lt;/li&gt;

        {% else %}

        &lt;li class="pagination__item btn  -current"&gt;
            &lt;span class="visuallyhidden"&gt;Current Page &lt;/span&gt;{{ i }}
        &lt;/li&gt;

        {% endif %}
    &lt;/li&gt;
    {% endif %}
    {% endfor %}

    {% if paginate.nextUrl %}
    &lt;li class="pagination__item"&gt;
        &lt;a class="btn  btn-2  btn-2a" href="{{ paginate.nextUrl }}{% if queryString is defined %}{{ queryString }}{% endif %}"&gt;
            &lt;span class="visuallyhidden"&gt;Next Page&lt;/span&gt;
            &amp;rarr;
        &lt;/a&gt;
    &lt;/li&gt;
    {% endif %}

&lt;/ol&gt;



&lt;/nav&gt;
{% endif %}

{% endif %}