Added function for pagination for news page