I don't really like these funcs that do x or y depending on a boolean.  Pass a lambda that takes care of the difference between pages and posts instead.