Displaying pages on an archive page

The issue turned out to be in another part of my code and nothing to do the the above query, which works just fine.