Fixed <li>s and new lines in pagination function

Fixes incorrect list item and new line output in the pagination function

### Changes

* Closed and opened the `li` on each side of the ternary values
* Wrapped `\n` in double quotes to properly expand in php

### Review

@germanny 
@ericrasch 
@jameswlane 

### Notes