0

I have this code that is not working as expected. No First or last or prev links will display...

{paginate}
                            {pagination_links}
                            <!-- post pagination -->
                            <nav class="post-pagination">
                                <ul class="pagination">
                                {first_page}
                                    <li class="pagination-first"><a href="{pagination_url}" rel="first"> First </a></li>
                                {/first_page}
                                {previous_page}
                                <li class="pagination-prev"><a href="{pagination_url}" rel="prev"> « </a></li>
                            {/previous_page}
                            {page}
                                <li class="pagination-num {if current_page}current{/if}"><a href="{pagination_url}"> {pagination_page_number} </a></li>
                            {/page}
                            {next_page}
                                <li class="pagination-next"><a href="{pagination_url}" rel="next"> » </a></li>
                            {/next_page}
                            {last_page}
                                <li class="pagination-last"><a href="{pagination_url}" rel="last"> Last </a></li>
                            {/last_page}
                            </ul>
                        </nav>
                        <!-- post pagination -->
                        {/pagination_links}
                        {/paginate}

I get this on the front end ... see attached. Any help would be appreciated.

enter image description here

1

First and last links in pagination appear only when there are at least 4 pages of entries. It's not in the main documentation but it's included in the user-contributed notes in the docs.

2
  • Still a little confused by this as I would like it if the first and last / prev and next links showed all the time. I thought they would by default and you would use the if statements to determine if they show. Any advice on this would be appreciated. Apr 1 '13 at 16:52
  • As Bhashkar indicated, try changing your limit parameter on your entries loop to something quite low to test for sure. The reason it doesn't show when there are fewer pages is to avoid duplication. On a pagination set with only two pages, for example, next page and last page would be links to the same page. Apr 1 '13 at 18:09
0

ExpressionEngine usually shows 3 pages. If there are more page than 3, then it will display "First" and "last". In your case, it seems there is only 2 pages.

You can check it by decreasing the limit value.

1
  • Many thanks. Shame it is not in the documentation. Apr 1 '13 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.