<p>When you use <code>{% paginate %}</code>, the second variable that's returned, <code>pageEntries</code>, is  the paginated entries. When you do <code>craft.entries.section('news').featured('not 1')</code> later in the template, you're doing a new query that's not paginated.</p>

<p>Assuming what you want is to return all featured entries at the top, then a paginated list of news below, try something like this:</p>

<pre><code>{% extends "_layout" %}
{% set title = "News" %}

{% paginate craft.entries.section('news').featured('not 1').limit(5) as pageInfo, pageEntries %}

{% block content %}
    &lt;section class="news-page section-wrap news-list"&gt;
        &lt;h1&gt;Company News&lt;/h1&gt;
        {% for featuredEntry in craft.entries.section('news').featured('1') %}
            &lt;article class="news-list--item news-list--feature"&gt;
                &lt;div class="feature-img"&gt;
                    {% for image in featuredEntry.featuredImage %}
                        &lt;img src="{{ image.getUrl('featuredArticleImage') }}" alt="{{ featuredEntry.title }}"/&gt;
                    {% endfor %}
                &lt;/div&gt;
                &lt;div class="feature-content"&gt;
                    &lt;h1&gt;&lt;a href="{{ featuredEntry.url }}"&gt;{{ featuredEntry.title }}&lt;/a&gt;&lt;/h1&gt;
                    {{ featuredEntry.body.getPage(1) }}
                    &lt;a class="btn btn-secondary" href="{{ featuredEntry.url }}"&gt;Continue reading&lt;/a&gt;
                &lt;/div&gt;
            &lt;/article&gt;
        {% endfor %}

        {% for regularEntry in pageEntries %}
            &lt;article class="news-list--item"&gt;
                &lt;a href="{{ regularEntry.url }}"&gt;
                    &lt;h2&gt;{{ regularEntry.title }}&lt;/h2&gt;
                    {{ regularEntry.body|hacksaw(words='25', allow='&lt;p&gt;&lt;b&gt;') }}
                    &lt;span class="cta-border"&gt;Continue reading&lt;/span&gt;
                &lt;/a&gt;
            &lt;/article&gt;
        {% endfor %}

    &lt;/section&gt;
    &lt;nav&gt;
        {% if pageInfo.prevUrl %}&lt;a href="{{ pageInfo.prevUrl }}"&gt;Previous Page&lt;/a&gt;{% endif %}
        {% if pageInfo.nextUrl %}&lt;a href="{{ pageInfo.nextUrl }}"&gt;Next Page&lt;/a&gt;{% endif %}
    &lt;/nav&gt;
{% endblock %}
</code></pre>

<p>If additionally, you only want to show the featured entry on the first page, you could wrap the first for loop in:</p>

<pre><code>{% if pageInfo.currentPage == 1 %}
    ...
{% endif %}
</code></pre>

<p>More details on pagination <a href="https://craftcms.com/docs/templating/paginate" rel="nofollow noreferrer">in the docs</a>.</p>

CC BY-SA 3.0
2016-11-14T20:05:33.147Z
ah, all that works well except removing the featured for any other page but the first. That if statement doesn't seem to be work. Thoughts?
Matthew Carleton
CC BY-SA 3.0
2016-11-14T20:42:00.523Z
@MatthewCarleton I just updated the code for the conditional that checks if the first page is being displayed.
carlcs
CC BY-SA 3.0
2016-11-14T21:03:33.073Z
Yes! that does it.
Matthew Carleton
CC BY-SA 3.0
2016-11-14T21:58:12.860Z
Ah, I was a bit too quick reading the docs there. Thanks, Carl. :)
André Elvan
CC BY-SA 3.0
2016-11-14T19:57:00.293Z
2016-11-14T20:40:57.747Z
2016-11-14T20:40:57.747Z
André Elvan
<p>I have the following code for my news page. The links show up but I'm seeing all the entries on every page. I'm not sure if this is related to my featured entry at the top.</p>

<pre><code>{% extends "_layout" %}
{% set title = "News" %}
{% paginate craft.entries.section('news').limit(5) as pageInfo, pageEntries %}
{% block content %}
&lt;section class="news-page section-wrap news-list"&gt;
&lt;h1&gt;Company News&lt;/h1&gt;
{% for featuredEntry in craft.entries.section('news').featured('1') %}
        &lt;article class="news-list--item news-list--feature"&gt;
            &lt;div class="feature-img"&gt;
                {% for image in featuredEntry.featuredImage %}
                &lt;img src="{{ image.getUrl('featuredArticleImage') }}" alt="{{ featuredEntry.title }}" /&gt;
                {% endfor %}
            &lt;/div&gt;
            &lt;div class="feature-content"&gt;
                &lt;h1&gt;&lt;a href="{{ featuredEntry.url }}"&gt;{{ featuredEntry.title }}&lt;/a&gt;&lt;/h1&gt;
                {{ featuredEntry.body.getPage(1) }}
                &lt;a class="btn btn-secondary" href="{{ featuredEntry.url }}"&gt;Continue reading&lt;/a&gt;
            &lt;/div&gt;  
        &lt;/article&gt;
{% endfor %}
{% for regularEntries in craft.entries.section('news').featured('not 1') %}
    &lt;article class="news-list--item"&gt;
            &lt;a href="{{ regularEntries.url }}"&gt;
            &lt;h2&gt;{{ regularEntries.title }}&lt;/h2&gt;
            {{ regularEntries.body|hacksaw(words='25', allow='&lt;p&gt;&lt;b&gt;') }}
            &lt;span class="cta-border"&gt;Continue reading&lt;/span&gt;
            &lt;/a&gt;
    &lt;/article&gt;
{% endfor %}

&lt;/section&gt;  
&lt;nav&gt;
{% if pageInfo.prevUrl %}&lt;a href="{{ pageInfo.prevUrl }}"&gt;Previous Page&lt;/a&gt;{% endif %}
{% if pageInfo.nextUrl %}&lt;a href="{{ pageInfo.nextUrl }}"&gt;Next Page&lt;/a&gt;{% endif %}
    &lt;/nav&gt;
{% endblock %}
</code></pre>

<pagination>
pagination showing all entries
# pagination showing all entries

(Asked by: username_0 on 2016-11-14)

I have the following code for my news page. The links show up but I'm seeing all the entries on every page. I'm not sure if this is related to my featured entry at the top.
{% extends "_layout" %}
{% set title = "News" %}
{% paginate craft.entries.section('news').limit(5) as pageInfo, pageEntries %}
{% block content %}

Company News
{% for featuredEntry in craft.entries.section('news').featured('1') %}
        
            
                {% for image in featuredEntry.featuredImage %}
                
                {% endfor %}
            
            
                {{ featuredEntry.title }}
                {{ featuredEntry.body.getPage(1) }}
                Continue reading
              
        
{% endfor %}
{% for regularEntries in craft.entries.section('news').featured('not 1') %}
    
            
            {{ regularEntries.title }}
            {{ regularEntries.body|hacksaw(words='25', allow='') }}
            Continue reading
            
    
{% endfor %}

  

{% if pageInfo.prevUrl %}Previous Page{% endif %}
{% if pageInfo.nextUrl %}Next Page{% endif %}
    
{% endblock %}

**Tags:** pagination


---

## 1 answers

### Answer by username_1 on 2016-11-14. Score: 2 | Accepted answer

When you use {% paginate %}, the second variable that's returned, pageEntries, is  the paginated entries. When you do craft.entries.section('news').featured('not 1') later in the template, you're doing a new query that's not paginated.
Assuming what you want is to return all featured entries at the top, then a paginated list of news below, try something like this:
{% extends "_layout" %}
{% set title = "News" %}

{% paginate craft.entries.section('news').featured('not 1').limit(5) as pageInfo, pageEntries %}

{% block content %}
    
        Company News
        {% for featuredEntry in craft.entries.section('news').featured('1') %}
            
                
                    {% for image in featuredEntry.featuredImage %}
                        
                    {% endfor %}
                
                
                    {{ featuredEntry.title }}
                    {{ featuredEntry.body.getPage(1) }}
                    Continue reading
                
            
        {% endfor %}

        {% for regularEntry in pageEntries %}
            
                
                    {{ regularEntry.title }}
                    {{ regularEntry.body|hacksaw(words='25', allow='') }}
                    Continue reading
                
            
        {% endfor %}

    
    
        {% if pageInfo.prevUrl %}Previous Page{% endif %}
        {% if pageInfo.nextUrl %}Next Page{% endif %}
    
{% endblock %}

If additionally, you only want to show the featured entry on the first page, you could wrap the first for loop in:
{% if pageInfo.currentPage == 1 %}
    ...
{% endif %}

More details on pagination in the docs.

> **Comments:**
> **username_0**: ah, all that works well except removing the featured for any other page but the first. That if statement doesn't seem to be work. Thoughts?  
> **username_2**: @MatthewCarleton I just updated the code for the conditional that checks if the first page is being displayed.  
> **username_0**: Yes! that does it.  
> **username_1**: Ah, I was a bit too quick reading the docs there. Thanks, Carl. :)  

---

