wp_pagination changes to support page templates