tjldesigns
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Post Type UI] Querying custom post type onlyActually Michael, this does actually raise a query.
When I add a custom post type (lawyers), I tick “Built-in Taxonomies” that I want to be able to tag the custom post type under. So in this case I have ticked it to have the custom taxonomies I have also created ie “services” and “expertise”.
But then also, when I created these custom taxonomies “services” and “expertise”, I also ticked “Lawyers” under the “Attach to Post Type” section.
So I am sort of applying this twice, is that right? Or could this be causing the issue? What is the difference and should I just be doing ticking it one area?
Sorry so many questions… Just hate not understanding the logic ??
Forum: Plugins
In reply to: [Custom Post Type UI] Querying custom post type onlyHi Michael,
Thanks so much for getting back :).
Yes both of those taxonomies are attached to the custom post type “lawyers” and to general posts too. And I think this seems to be where the issue is cropping up… As if I change the query to :
'post_type' => 'lawyers', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', 'tax_query' => array( 'relation' => 'AND', array( 'relation' => 'OR', array( 'taxonomy' => 'services', 'field' => 'slug', 'terms' => $tax_sectors_slugs, ), array( 'taxonomy' => 'expertise', 'field' => 'slug', 'terms' => $tax_practices_slugs, ), ), ),
Basically just adding that extra nested array with ‘relation’ => ‘AND’, it then works perfectly.
SImilarily, if I remove all taxonomy querying, then it only shows me “lawyers” no general posts.
But the point remains that I think my original query should just work as is shouldn’t it as I’ve used this before on other sites and it has worked I’m pretty sure… ie :
$wpbp = new WP_Query(array( 'post_type' => 'lawyers', 'posts_per_page' =>'-1', 'orderby' => 'title', 'order' => 'ASC', 'tax_query' => array( 'relation' => 'OR', array( 'taxonomy' => 'services', 'field' => 'slug', 'terms' => $tax_sectors_slugs, ), array( 'taxonomy' => 'expertise', 'field' => 'slug', 'terms' => $tax_practices_slugs, ), ), ) );
What do you think?
Also sorry I updated the -1 thank you, and just to confirm nothing in the theme is overriding or affecting the queries.
Many thanks ??
Ahh it will be brilliant if you can get this working, will just make your amazing plugin even more amazing ha ha! I know I keep saying it, but you’ve done an excellent job with it, I love it!
Ah thanks Darren, sorry for not spotting this. I wonder though is this something that may be updated at some point down the line, or is it literally just not possible at all? Many thanks ??
Great thanks Darren, I may have a play with that ??
Hey Darren,
So basically in WP queries I can set nested queries so I can say show me all posts from category = x AND (taxonomy = a OR taxonomy = b OR taxonomy = c)
And I think by what you are saying via your plugin we can’t quite get this level of querying as it is all the same level of querying (without the ability to nest).
So if I do this :
[ajax_load_more post_type=”post” category=”opinions” taxonomy=”sector:practice:country” taxonomy_terms=”mining, oil-and-gas:banking-and-finance, corporate:africa” taxonomy_operator=”IN:IN:IN” taxonomy_relation=”OR”]
Even though I have Category set to Opinions, as I have multiple taxonomies and the relationship set is OR, this OR applies across the board, meaning that I am in fact not just getting the category I have set, I will get results of any Category.
The alternative is to change it to relationship AND as below :
[ajax_load_more post_type=”post” category=”opinions” taxonomy=”sector:practice:country” taxonomy_terms=”mining, oil-and-gas:banking-and-finance, corporate:africa” taxonomy_operator=”IN:IN:IN” taxonomy_relation=”AND”]
But then sadly as the taxonomy is set to AND, it will only show me Opinions which are in ALL the Taxonomy pots which sadly is too specific and massively minimises the results.
Do you think this might be something that could be possible in future? ??
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Order by optionsThat will be perfect, saves people like me bugging you haha ??
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Order by optionsHey Darren,
That’s EXACTLY what I wanted, so sorry! I actually didn’t realise you could order by multiple already as in the shortcode builder it only lets you select one field to order by, so I just stuck with that.
It’s now working perfect thank you, but for your plugin maybe a future consideration would be to allow to set this via the shortcode builder? Could be really handy.
Thank you for getting back to me ??
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Order by optionsHey Darren, just wanted to check if you had any advice on my ordering thoughts above, hope it makes sense ??
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Order by optionsHmmm also just wondered if what I need to do isn’t possible currently, could I amend the ordering via https://connekthq.com/plugins/ajax-load-more/docs/filter-hooks/ > alm_modify_query_args ?
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Order by optionsActually that would be a great future feature to allow for this to be controlled via the builder, ie primary order by (the existing option), then maybe a secondary order by.
As in my example I need it to revert to default date ordering, but you could have another scenario where say it was a Team page, where you wanted Key Team members at the top, then in this case you would want the secondary ordering to be by say Post title (ie name).
Anyway I shall stop bugging you now :).
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Order by optionsHey Darren,
Thanks so much for your quick reply, getting there, I now added:
meta_key="post_featured" meta_value="1" meta_compare="<=" meta_type="NUMERIC" orderby="meta_value_num"
My field is basically 1 = featured, 0 = not featured, so that is now working – GREAT :). My challenge now is that the Featured element is to override default date ordering, but I need it to fall back to default date ordering as secondary ordering. So it basically shows all featured posts in date order first, followed by all non featured posts in date order, but I don’t think it’s doing that, and is it possible to do that as that would be super useful I think?
Thank you again ??
Forum: Reviews
In reply to: [WordPress Infinite Scroll - Ajax Load More] Excellent plugin!You’re more than welcome Darren, the more I use it the more I love it, it’s just so flexible and easy! You’ve done a truly amazing job with it. Not only that you always get back to support queries too which is so good of you – thanks so much again ??
Ignore all this I fixed it!! ??
Sorry, I also forgot to say they are also not auto-showing on scroll, you have to hit load more to reveal more, but that was happening before masonry in case that helps?