Fixes pagination on permalinks