Home › Forums › Backend Issues (wp-admin) › Post category rule isn't limiting category
I have set up a location rule for my field group:
Post Category is equal to Category Example
Problem is, it’s not actually limiting the field group to my “Category Example” posts. The field group shows up in all categories.
I also tried adding rules for “Post Category” “is not equal to” “Other Category” for each of the other categories but then the fields won’t show up even with the “is equal to” category.
Thanks for your help
Hi @cerulean
Can you please include a screenshot of the field group showing the location rules?
Thanks
E
Hi @cerulean
If you create a post, select the correct category and save the post. Does the reloaded page show the fields?
Yes, when I click the correct category, then the fields appear. The problem is the same thing happens when I click the wrong category (any category).
Hi @cerulean
Thanks for all the info. Yes, can you please post some login credentials for me?
Just mark the reply as ‘private’
Thanks
E
Hi @cerulean
Thanks for the details. I’ve logged in and yes, I can see the issue.
For some reason, ACF is posting multiple category values off to the AJAX call even when the page has no categories selected…
I’ll do some local testing and find a solution soon.
Cheers
E
Hi @cerulean
The issue was a strange one, but I’ve tracked it down and fixed it.
A plugin you use (Post Expirator) is creating extra category check-boxes on the page which are being read by ACF and posted to the AJAX compare function.
I have added a fix to the JS that now makes sure the check-box it see’s is visible and not disabled.
Your version of ACF now contains this patch and it will also be included in the next version of ACF.
Cheers
E
Hi elliot,
I met the same problem. But my backend is in Chinese. Could post the detail solution here? Or could you just send it to me? I set equal or not euqual, the fields show up in all posts all categories.
Urgent!…Could you help me out? Thank you in advance.
Hi @cerulean
You can download the latest version of ACF here:
https://github.com/elliotcondon/acf
This version contains the fix which is found in the JS/input/ajax.js
Cheers
E
The topic ‘Post category rule isn't limiting category’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.