Added sidebar logic and pagination logic in homepage