SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #7 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'architeadb6.term.name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by Raw SQL : SELECT post.ID,post.post_title as title, post.category_name as category,CONCAT( SUBSTRING_INDEX(post.guid, '?', 1),'wp-content/uploads/', thumb.meta_value) as image,CONCAT(SUBSTRING_INDEX(post.guid, '?', 1),post.post_name,'/') as 'url',post.post_type FROM (SELECT p.ID,p.post_title, p.guid, p.post_type, p.post_name, MAX(CASE WHEN pm.meta_key = '_thumbnail_id' then pm.meta_value ELSE NULL END) as thumbnail_id, term.name as category_name, term.slug as category_slug, term.term_id as category_id FROM architect_posts as p LEFT JOIN architect_postmeta as pm ON ( pm.post_id = p.ID) LEFT JOIN architect_term_relationships as tr ON tr.object_id = p.ID LEFT JOIN architect_terms as term ON tr.term_taxonomy_id = term.term_id WHERE p.post_status = 'publish' AND p.post_type='post' GROUP BY p.ID ORDER BY p.post_date DESC LIMIT 3 ) as post LEFT JOIN architect_postmeta AS thumb ON thumb.meta_key = '_wp_attached_file' AND thumb.post_id = post.thumbnail_id