How to hide pagination in a template when there is only one page
{paginate}
{if total_pages>1}
<div class="pagination">
Page {current_page} of {total_pages} pages : {pagination_links}
</div>
{/if}
{/paginate}
How to hide pagination with css when there is only one page
Here we just put the pagination in the webpage, but hide it with css,
depending on the total_pages variable:
.pagination {
color...
background... etc.
}
.pages1 {
display:none;
}
in the template, we set the default pagination-class on the pagination div and set a second class with the number of total pages (pagesX). The defintion ending in ‘1’ has the display property of ‘none’, so that will be hidden. (pages2 and pages3, etc. are not defined in CSS and will therefore not be hidden :-)
{paginate}
<div class="pagination pages{total_pages}">
Page {current_page} of {total_pages} pages : {pagination_links}
</div>
{/paginate}
Based upon the method used by “Luke S.” forum-thread ”Embed/include {pagination} tags?.”
