why {% if current_page == 1 %} doesn't work

Highlighted
New Member
2 0 0

Hi!  I want the collection description shows only on the first page.
I Have a code, but it don't work:

<div class="page__header-wrapper">
<div class="container">
<h1 class="page__title">{% if collection.handle == 'all' %}All Watches{% else %}{{ collection.title }}{% endif %}</h1>

{% if current_page == 1 %}
<div class="page__description rte">
{{ collection.description }}
</div>
{% endif %}

{% if collection.all_products_count == 0 %}
<div class="page__description page__description--centered">
<p class="rte">{{ 'collection.general.empty' | t }}</p>

<div class="page__header-actions">
<a href="{{ shop.url }}" class="button button--primary">Let's shop!</a>
</div>
</div>
{% endif %}
</div>
</div>

 

Help me please.

0 Likes
Highlighted
Shopify Expert
2620 440 564

Hi @zav 

 Your condition is right may be its other issue on page, BTW on with file you are adding this condition:

{% if current_page == 1 %}
   <div class="page__description rte">
    {{ collection.description }}
   </div>
{% endif %}

Note:  It can be used outside the paginate block.

Send you store url

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Excursionist
13 2 3

Try adding this in the pagination block

 

 

{% unless paginate.current_page == 1 %}
<style>
.page__description {display: none;}
</style>
{% endunless %}

 

I make custom Shopify pages & themes.. rgeekdigital.com | info@rgeekdigital.com
0 Likes
New Member
2 0 0

Didn't help. Description is hidden on all pages

0 Likes