<p><strong>UPDATED/EDIT ANSWER:</strong></p>

<p>If you only want to show the entries on the first page you should make an if statement to check if you are on the first page for your Featured Items by requesting the page number.</p>

<p><strong>Option 1:</strong></p>

<pre><code>{% if craft.request.getPageNum() == 1 %} 

// Featured content here

{% endif %}
</code></pre>

<p><strong>Option 2:</strong></p>

<pre><code>{% if craft.request.getLastSegment() == 'p1' %} 

// Featured content here

{% endif %}
</code></pre>

<p>The first option is the best / cleanest solution even though they give the same outcome. Option 2 is a nice work around but might be more usefull in other ways then this one. </p>

<p>More about craft requests can be found in the docs:
<a href="https://craftcms.com/docs/templating/craft.request" rel="nofollow noreferrer">https://craftcms.com/docs/templating/craft.request</a></p>

CC BY-SA 3.0
2017-03-15T16:15:51.287Z
It's not that I'm trying to remove Featured news out of the pagination. I need to remove the featured news items out of the template if the page isn't the first. So when the user goes to page 2 the Featured news items aren't at the top.
sarah3585
CC BY-SA 3.0
2017-03-15T16:19:45.697Z
Then I should make an if statement that that gets the page by your "last segment" Ill update the answer
Justin Dekkers
CC BY-SA 3.0
2017-03-15T17:11:33.417Z
Thanks, I ended up using {% if craft.request.getPageNum() == 1 %} which you put me on the right path for. Update your answer and I'll mark it correct as you got me 99% there.
sarah3585
CC BY-SA 3.0
2017-03-15T15:41:19.503Z
2017-03-16T15:58:16.520Z
2017-03-16T15:58:16.520Z
Justin Dekkers
<p>I have some Featured news entries which appear at the top of the rest of the news entries.</p>

<p>How do I set this so they are only on page 1 (before any pagination pages)?</p>

<pre><code>{# Only show on page 1 of pagination #}

   {% for entry in craft.entries.section('newsEvents').highlightNews('1').limit(2) %}

   &lt;div class="col-12 {% if loop.index is divisibleby(2) %}last{% endif %} panel "&gt;

     {% if entry.listingImage|length %}
    {% for image in entry.listingImage %}
      &lt;div class="panel__img"&gt;
        &lt;a href="{{ entry.url }}"&gt;&lt;img src="{{ image.getUrl('listingMedium')}}" alt="{{ image.title }}" /&gt;&lt;/a&gt;
      &lt;/div&gt;

    {% endfor %}

    {% endif %}

  &lt;/div&gt;

{# End only show on page 1 of pagination #}



{% paginate craft.entries.section('newsEvents').limit(12) as entriesOnPage %}

  {% for entry in entriesOnPage %}

    ...

  {% endfor %} 


{% if paginate.totalPages &gt; 1 %}

{% set pagination = true %}

  &lt;ul class="pagination"&gt;
    {% if paginate.prevUrl %}&lt;li&gt;&lt;a href="{{ paginate.prevUrl }}"&gt;&amp;#171;&lt;/a&gt;&lt;/li&gt;{% endif %}

    {% for page, url in paginate.getPrevUrls(5) %}
        &lt;li&gt;&lt;a href="{{ url }}"&gt;{{ page }}&lt;/a&gt;&lt;/li&gt;
    {% endfor %}

    &lt;li class="current"&gt;{{ paginate.currentPage }}&lt;/li&gt;


    {% for page, url in paginate.getNextUrls(5) %}
        &lt;li&gt;&lt;a href="{{ url }}"&gt;{{ page }}&lt;/a&gt;&lt;/li&gt;
    {% endfor %}

    {% if paginate.nextUrl %}&lt;li&gt;&lt;a href="{{ paginate.nextUrl }}"&gt;&amp;#187;&lt;/a&gt;&lt;/li&gt;{% endif %}

 &lt;/ul&gt;

{% endif %}
</code></pre>

CC BY-SA 3.0
2017-03-15T15:41:52.440Z
Could you provide the method on how you tell if some entries are featured
Justin Dekkers
CC BY-SA 3.0
2017-03-15T16:14:35.030Z
Updated code. I'm using a lightswitch.
sarah3585
<pagination>
Check which pagination page to display code outside of pagination loop
# Check which pagination page to display code outside of pagination loop

(Asked by: username_0 on 2017-03-15)

I have some Featured news entries which appear at the top of the rest of the news entries.
How do I set this so they are only on page 1 (before any pagination pages)?
{# Only show on page 1 of pagination #}

   {% for entry in craft.entries.section('newsEvents').highlightNews('1').limit(2) %}

   

     {% if entry.listingImage|length %}
    {% for image in entry.listingImage %}
      
        
      

    {% endfor %}

    {% endif %}

  

{# End only show on page 1 of pagination #}



{% paginate craft.entries.section('newsEvents').limit(12) as entriesOnPage %}

  {% for entry in entriesOnPage %}

    ...

  {% endfor %} 


{% if paginate.totalPages > 1 %}

{% set pagination = true %}

  
    {% if paginate.prevUrl %}«{% endif %}

    {% for page, url in paginate.getPrevUrls(5) %}
        {{ page }}
    {% endfor %}

    {{ paginate.currentPage }}


    {% for page, url in paginate.getNextUrls(5) %}
        {{ page }}
    {% endfor %}

    {% if paginate.nextUrl %}»{% endif %}

 

{% endif %}

**Tags:** pagination
> **Comments:**
> **username_1**: Could you provide the method on how you tell if some entries are featured  
> **username_0**: Updated code. I'm using a lightswitch.  

---

## 1 answers

### Answer by username_1 on 2017-03-15. Score: 3 | Accepted answer

UPDATED/EDIT ANSWER:
If you only want to show the entries on the first page you should make an if statement to check if you are on the first page for your Featured Items by requesting the page number.
Option 1:
{% if craft.request.getPageNum() == 1 %} 

// Featured content here

{% endif %}

Option 2:
{% if craft.request.getLastSegment() == 'p1' %} 

// Featured content here

{% endif %}

The first option is the best / cleanest solution even though they give the same outcome. Option 2 is a nice work around but might be more usefull in other ways then this one. 
More about craft requests can be found in the docs:
https://craftcms.com/docs/templating/craft.request

> **Comments:**
> **username_0**: It's not that I'm trying to remove Featured news out of the pagination. I need to remove the featured news items out of the template if the page isn't the first. So when the user goes to page 2 the Featured news items aren't at the top.  
> **username_1**: Then I should make an if statement that that gets the page by your "last segment" Ill update the answer  
> **username_0**: Thanks, I ended up using {% if craft.request.getPageNum() == 1 %} which you put me on the right path for. Update your answer and I'll mark it correct as you got me 99% there.  

---

