I’m using the shortcode above but the result is showing all posts under “city” terms
Isn’t that what you would expect? All posts with ‘city’ as the custom taxonomy value?
Or is the category not working?
I have one custom post type “mypost” and one custom taxonomy “place” and terms “city”
but I have many categories:
-trips
-play
-more…
what i want is to show all custom post filtered by “city” terms and “trips” category.
But what i’ve got is showing all the posts under custom taxonomy.
taxonomy is working
echo do_shortcode('[ajax_load_more post_type="mypost" taxonomy="place" taxonomy_terms="city"]');
categories is also working
echo do_shortcode('[ajax_load_more post_type="mypost" category="trips"]');
but if i combined them error occur
echo do_shortcode('[ajax_load_more post_type="mypost" taxonomy="place" taxonomy_terms="city" category="trips"]');
result of combined codes:
all city posts display on the top but in the bottom display all the trip categories
what I want is to display all “trip” categories under the “city” taxonomy
Hi,
Not sure why this wouldn’t be working – I’ll try to test this out and let you know. Might be a while though because of the holidays.
Cheers,
I believe the issue is related to the way the plugin had been built.
In order to query by custom taxonomy and category we need to combine the two into a single tax_query.
Currently, the out of the box WP category and tag parameters are being queried separately from the custom taxonomy query.
I’m not sure when I can work on a fix for this, but will post back here if I am able to solve this issue.
Cheers,
I’m also interested in the, I have the exact same issue with querying a custom taxonomy – just not working. THanks
It seems it only doesnt work when you query a category, and then query a taxonomy term at the same time, if I try it without querying a category, the the taxonomy filter works fine. I do need to be able to query both.
Hope that helps!
Thanks dcooney, looking someday for this to be functional.
For now, i will try your suggestion to combine it in single tax_query
Thanks
I cannot get this to work within a single tax_query, are there any tips on getting it to work?
I actually think I found the reason this query is not working.
Under the taxonomy settings in the backend of ALM I have 'releation' => 'OR'; but I really think it should be 'relation'=>'AND';
If you want to update this yourself the file is ajax-load-more.php line 421.
Can either of you test this out? If it does work I will add this change and post a hotfix to the wordpress.org repo.
Hi dcooney
I tried your solution to change the relation of taxonomy to “AND” and it works perfect.
Thanks for your help I can proceed now to my other tasks
Keep it up!