GonzaloTorreras / hs-blog-numbered-pagination

Improved num. blog pagination from JasonRosa

Home Page:https://designers.hubspot.com/code-gallery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Numbered Blog Pagination

Purpose: to add basic numbered pagination to a HubSpot blog.

Instructions

Add this snippet in the blog listing template HTML outside of the main blog for loop where you want the pagination to show.

You can easily choose the number of links to display with the offset variable. It will generate from the (current page - offset) to (current + offset ) plus the current page. So by default (2), if you are in the page num 3 you will see from 1 to 5.

If for any reason you want to choose the pages to display manually, for example if you we are in the page num 10 and want to display links to: < 5 8 9 10 11 12 15 >, you can do it hardcoding the page_list array as in the commented line.(what are you doing weirdo?)

Image of inline styling on media

About

Improved num. blog pagination from JasonRosa

https://designers.hubspot.com/code-gallery

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:HTML 54.8%Language:CSS 43.8%Language:JavaScript 1.4%