Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Filtering on multiple categories
SELECT count( cp.entry_id ) AS total_items,
c.cat_name as category_name,
c.cat_url_title as category_url_title
FROM exp_weblog_titles AS wt
INNER JOIN exp_category_posts AS cp ON wt.entry_id = cp.entry_id
INNER JOIN exp_categories AS c ON cp.cat_id = c.cat_id
INNER JOIN exp_category_posts AS cp2 ON wt.entry_id = cp2.entry_id
INNER JOIN exp_categories AS c2 ON cp2.cat_id = c2.cat_id
WHERE wt.weblog_id = 57
AND wt.status != 'closed'
AND c.site_id = 8 AND c2.site_id = 8
AND c.group_id = 40 AND c2.cat_id = {segment_2_category_id}
GROUP BY c.cat_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.