Bootstrap 3 Pagination in WordPress

The function below will assist you to smoothly add pagination in your WordPress theme using Twitter Bootstrap 3 pagination style. This function is easy to read and to customize as well as contains features like:

  • Bootstrap Styling
  • First and Last Button
  • Previous and Next Button
  • Current page & total number of pages
  • First/Last text invisible on small devices
  • Previous/Next text invisible on small devices
  • Works with custom post types by passing parameters to function

Bootstrap 3 Pagination in WordPress

Note: This navigation function requires that you have already included bootstrap theme or CSS in your WordPress blog or website.

If you wish to get this function for Bootstrap 4, here is the post:

WordPress Pagination In Bootstrap 4 Style – Function

Bootstrap 3 Pagination in WordPress

Add the following function to your ‘functions.php‘ file in WordPress theme.

In your archive files wherever you want to show pagination, call the function: 

The line #4 in the code above is an example to apply pagination if you are using custom query and if you wish to let pagination appear to its default position (not at center of the column), delete line number #41 and #73 from function. Now all is done! Check your WordPress website with Bootstrap theme to see Pagination live.

You Might Interested In