Timeline for Custom Taxonomy and tax_query Issue?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 1 at 6:07 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
May 28 at 2:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Apr 25, 2018 at 14:50 | answer | added | Krzysiek Dróżdż | timeline score: 0 | |
Mar 14, 2017 at 3:13 | history | tweeted | twitter.com/StackWordPress/status/841487539089301506 | ||
Jan 29, 2016 at 19:01 | comment | added | Howdy_McGee♦ |
I used the capitalization and didn't run into an issue. Maybe break your code into bits to ensure you're getting the expected data. print_r( $get_categories ); before the loop to ensure your terms are in there. Mayb remove your WP_Query from the for loop and pass in a string slug that you know has posts assigned to it to ensure your WP_Query works.
|
|
Jan 29, 2016 at 18:59 | comment | added | raxa |
@Howdy_McGee as i have pasted this question in stack overflow where I got its solution by using 'taxonomy' => 'team_category','terms' => $category_name, and changing Team_Category to team_category .. but I don't know why this code is not running 'tax_query' => array(array( 'taxonomy' => 'team_category', 'field' => 'slug', 'terms' =>$category_name)) even i have changed Team_Category to team_category
|
|
Jan 29, 2016 at 18:43 | comment | added | Howdy_McGee♦ | it seems like the code is fine. I copied / pasted it and I didn't have a problem with it. Are you certain that the category has posts attached to it? | |
Jan 29, 2016 at 18:32 | comment | added | raxa | @Howdy_McGee Nothing happens still same situation... | |
Jan 29, 2016 at 18:27 | comment | added | Howdy_McGee♦ |
What happens if you wrap your $category_name in an array()? Like so: 'terms' => array( $category_name ) .
|
|
Jan 29, 2016 at 18:20 | history | asked | raxa | CC BY-SA 3.0 |