I’m sorry you’re still having trouble with this. Unless someone can reproduce your problem, it’s impossible to propose a solution. I initially thought I could reproduce the problem, but it turned out I had mis-typed one of the category term slugs in my URL. So anything I said related to what the issue might be has no significance. In any case, I got a failed query due to the 0=1. In your case, the query is working, but not the way you expected.
Your problem is almost certainly due to theme or plugin influence. Have you tried using the Health Check and Troubleshooting plugin’s troubleshooting mode? This deactivates all plugins and switches to a default theme for your view only. Other visitors will still see your normal site with your theme and all plugins active. In troubleshooting mode, multiple category requests should work as expected.
With your example URL, are you sure that you’re getting products listed that are not in the vegan category? Do not rely on page titles, they normally only list the first category even though multiple categories are specified. The products listed should have both categories assigned despite the Balea page title.
Hi, so i’ve installed and run that Plugin. Even with Twenty-Twenty Two and no active Plugins this issue persists.
Yes, i am sure, that non-vegan products are shown (The Balea Lippenbalsam Intensiv contains Beewax and is not categorized as vegan, stills shows up in the results).
Would vegan be a child category by any chance? Child categories are considered to be in the parent or ancestor categories, even when not explicitly assigned. This can lead to unexpected query results.
While it’s difficult to determine the cause if it’s not reproducible on other sites, there’s a possibility of overriding what ever had gone wrong by directly composing the proper SQL query and imposing that on the process in favor of whatever WP had come up with. Composing a query from any random term1+term2 request gets rather involved, but it’s possible.
You can override the WP SQL through the “posts_request” filter. Whatever SQL a callback returns will be used to fulfill the request.
Hi, all Categories are child categories. As i moved in 2019 from Blogger with already over 2.500 Posts and ~600 categories, they all just been made into parent categories. Also i can’t create 10.000+ manually added SQL Queries. For each brand (more than 800) there would have to be added more than 20 +markers. Vegan, parabenfree, siliconefree, etc.
And as WordPress genuinely for more than two years output them just like that, i simply want to go back to that.
I also have simply no idea about SQL nor PHP. I’ve worked nearly ten years with Blogger and moved to WordPress for simplicity in adding functions (like simple feedback forms). I do absolutely not know how to add any filter. PHP to me is literally gibberish. I have no clue how it works and i can’t wrap my head around it.
Child categories are all implicitly part of the common ancestor, but it’d only be a factor here if balea or vegan were themselves parents of other child categories. Then any products having only those child categories would still be included in category requests for their parents. Requesting a child should not yield products only assigned their parent categories. The implicit relationship should only work downwards, not upwards.
Assuming the parent/child thing is not the issue here, there’s something very odd about your particular installation, as evidenced by no one else being able to reproduce the same problem. While it is fixable, doing so requires a level of access to your site that is beyond the scope allowed in these public forums. You’d likely need to hire a developer to hook into that filter and patch up the SQL so that it works the way you need it to. Or better yet, determine the root cause and correct it.
If you don’t already know of a developer, a couple possible resources are https://jobs.wordpress.net/ or https://jetpack.pro/. There are also local meetups in many urban centers where WP developers get together IRL. If any are near you, you can likely find help there.
Please do not attempt to solicit paid help through these forums, doing so is against our guidelines and is unsafe. Go through proper channels intended for the purpose. I recommend you ignore any unsolicited contacts that may arise as a result of this topic. People that do that likely don’t have your best interests at heart 🙁
But how am i supposed to pay for a developer? i have nearly no income through the site and i’ve been doing it for 11 years simply because no one else took the time to actually go full-in to the details of formulas and cosmetics.
Also, the two links you provided both have no purpose. The first one is people looking for hiring developers, not for actually finding someone; the second one is nothing but the website to the jetpack plugin, which i don’t use or need.
Also i think that this should actually be contributed to WordPress. Maybe at some point this becomes a regular problem. I think i’m not the only one with 3000+ posts and 1000+ categories; so it is likely that this at some point will happen again.
Also i am not able to fundamentally learn and fix something i have no clue off. i’d love to read about SQL (and i did; for weeks now) and i don’t understand a thing.
So at this point i’m actually happy to create a database backup and give ANYONE access to my site who truly thinks they could solve this. I switched to WordPress because i wanted to do things better but since the first day i only struggled with it. Although 2/3 of the web relies on WordPress i truly believe it has never been created to have a couple of hundred posts. It only makes problems and anyone just wants to make money.
The GPL License too: it’s supposed to be a free web and literally ANYTHING costs money. I have not seen a single person who actually wanted to contribute something apart from the core-team.
At this point i’m just restless. I am at a point where everything just makes no fun anymore. I can’t use my own website how i want to because a SINGLE FUNCTION apparently ruins everything.
Sorry but i just feel helpless and sad. All i want to do is making it easy for people to filter out by a simple link and after 2 years of perfectly working it simply doesn’t, without me doing anything. And that just makes me crazy. No alteration helps. I tried hundreds of different link formats and no one takes more than the first category put in the link
- The topic ‘Show posts that are in both categories via cat1+cat2 in url doesn’t work’ is closed to new replies.