added endfor endif to page links

Oppps.