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
Can you please include a screenshot of the field group showing the location rules?
Sure. Here goes.
I can provide an admin login if needed to help resolve. Thanks.
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).
Thanks for all the info. Yes, can you please post some login credentials for me?
Just mark the reply as ‘private’
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.
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.
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.
You can download the latest version of ACF here:
This version contains the fix which is found in the JS/input/ajax.js
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.