Help Structuring Query for Archive Pages

I would do multiple queries. I know that generally that slows stuff down, but sometimes if you’re looking a page with a ton of content, it’s to be expected.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)