WordPress categories issue

44 views
asked Sep 21, 2013 in Website Builder by DinoGuy (2,130 points)
Hi there
I would appreciate any help on this as I couldn’t find an answer anywhere..
When I am on a category page  like www.mydomain.com/cetegory/uncategorized , it’s very simple to get the category ID of my current category. I can simply use get_query_var( 'cat' )
However I want to get all categories IDs and slugs. When I use a number of categories on tmy category page like this:
http://www.mydomain.com/?category_name=cat1+cat2+cat3
The category page however lists only the first category name (ie cat1)
How can I make the category page lists all categories?
Can anyone please help?
Thanks

1 Answer

0 like 0 dislike
answered Sep 21, 2013 by WebProX (12,200 points)
If you want to get the query variables as they are in the URL you can  use $wp_query
You can also get your category names using this code
global $wp_query;
$wp_query->query['category_name']
...