Hi, thanks for this. It comes close to what I wanted & found my solution from this hint you provide.
Thanks Very Much & Merry Xmas.
Here is my solution.
The string that I am passing is actually:
Here is my code:
$cats = explode('=', $_SERVER['QUERY_STRING']);
echo $_SERVER['QUERY_STRING']. ' is server query | ';
echo count($cats). ' is count | ';
echo $cats. ' is 0 | ';
echo $cats. ' is 1 | ';
echo $cats. ' is 2 | ';
echo $cats. ' is 3 | ';
if (count($cats) > 2) :
echo get_the_category_by_id($cats). ' and '. get_the_category_by_id($cats). ' categories.';
echo get_the_category_by_id($cats). ' category.';
Here is my output:
s=&cat=3&cat=12 is server query | 4 is count | s is 0 | &cat is 1 | 3&cat is 2 | 12 is 3 | All Learning Providers and All Locations categories.
I know it is not 'neat' to pass a string like '3&cat' to get_the_category_by_id() function, but this this case, WordPress is smart enough to pick up the cat_id. I am really pleasantly surprised by this.