A Database Error Occurred

Error Number: 3065

Expression #1 of ORDER BY clause is not in SELECT list, references column 'egsgov_egs.p.post_date' which is not in SELECT list; this is incompatible with DISTINCT

SELECT DISTINCT YEAR(post_date) pd, MONTH(post_date) pdm FROM (`wp_posts` p) WHERE `p`.`post_type` = 'post' AND `p`.`post_status` = 'publish' ORDER BY `post_date` desc

Filename: /home/egsgov/application/models/wordpress_model.php

Line Number: 409