Reply To: Custom Query
In case anyone else wonders, this is how I did it.
`
add_shortcode(‘factioncount’, ‘FactionCount’);
function FactionCount() {
global $wpdb;
//my table
$table = $wpdb->prefix . “bp_groups_groupmeta”;
prefix . “bp_groups_groupmeta”;
//query for my tags
$ald_tags = $wpdb->get_results(“SELECT * FROM {$table} WHERE meta_key = ‘gtags_group_tags’ AND meta_value LIKE ‘%aldmeri-dominion%'”);
$ald_tags = (array_filter($ald_tags));
print_r($ald_tags);
$ald_tags = count(array_keys($ald_tags));
return $ald_tags;
}
?>
`