
Hi @dashaluna
Yes, there are location rules for taxonomy.
This will allow you to create a Video and select a taxonomy (not sure what your taxonomy name is), and ACF will fetch any field groups with matching location rules given the taxonomy selection.
Thanks
E

Hi @dahousemix
Thanks for the detail and screenshot, very clear!
Is the taxonomy field within the field group that has the location rule for ‘Manga’?
Perhaps the issue is that when you trigger a change on the taxonomy checkbox field, ACF looks to see if the location rule matches and hides the field group?
Great. I got it working too.
Is there a way this can be applied only to 1 specific taxonomy field? I have a filter that’s useful for one taxonomy field but not something I’d want to apply to all my taxonomy fields.
I tried in my add_filter function using ‘acf/fields/taxonomy/wp_list_categories/name=XYZ’ but that didn’t work (the field just displayed all the categories)
Alternatively I just might not be understanding this correctly.
Thanks
Sorry, I’ll try to make it simple.
For example, I have a custom type post with 3 custom taxonomies.
I created a Field Group in ACF with the location rule to show up only if the first taxonomy is “Manga”. (see below)

Then I added a taxonomy field populated by another custom taxonomy and set the type to “checkbox”.

So now when I create or edit a custom post, I choose the taxonomy “Manga” so that my Field Group show up.
But after that, if I use the checkbox field, my Field Group just hides again.


Hi @colin
There are a few issues with your above code.
1. Misuse of the the_field function. This should be get_field.
2. The taxonomy field does have a drop-down (single select) mode
3. the param ‘cat’ expects an integer. If you selected checkbox for the field type, you will have an array of ids, not just one.
I would advise you to change the taxonomy field type to a single select, and then fix up the code from point 1.
Good luck
Cheers
E

Hi @MatsKruger
In both screenshots you have highlighted 2 completely different UI elements.
In the first screenshot, you have highlighted the native WP category box. Then in the popup, you have highlighted a text field.
Are you sure you are using ACF to create this taxonomy field?

Please see this article to load data from a term:
http://www.advancedcustomfields.com/resources/how-to/how-to-get-values-from-a-taxonomy-term/
Thanks
E

If a ‘category’ is a standard WP taxonomy, then I don’t think this is an ACF question.
You should ask general WP questions on a WP forum such as stack overflow.
Thanks
E
Hello Elliot
Here is my code from the function.php
function create_taxonomies() {
// Add new taxonomy, make it hierarchical (like categories)
$labels = array(
‘name’ => __( ‘Tøjer’ ),
‘singular_name’ => __( ‘Tøj’ ),
);
$args = array(
‘hierarchical’ => true,
‘labels’ => $labels,
‘show_ui’ => true,
‘show_admin_column’ => true,
‘query_var’ => true,
‘rewrite’ => array( ‘slug’ => ‘toj’ ),
);
register_taxonomy( ‘toj’, array( ‘attachment’ ), $args );
}
And an image how it looks in media tab and an image how it looks i the gallery edit media popup
Hope it helps
Thanks

Hi @MatsKruger
Can you post a screenshot of the fieldgroup showing the field in question? What field type is it?
Thanks
E
Hi Elliot,
I had a go at the latest ACF. Results are mixed: checkboxes do now work, and previous information (stored with previous version of ACF) is retained between multi-select and the checkboxes. However – and this is possibly because I am using the taxonomy with images / attachments and not with posts (I didn’t test it with posts), this occurs: all the fields and their values are listed with no elaborate formatting, and then underneath they are listed again properly formatted with tabbing. Only changes made to the checkboxes in the second listing are retained on clicking ‘update’. I reverted back to the previous ACF and all is working – though only if using multi-select, as before.
Thanks for persisting with this.
Best, Peter
Hey, just wanted to let you know that this works great – was able to add this line:
$args['depth'] = 1;
to the filter function and only show the top level taxonomy terms in the edit screen

Hi @pfitz
Thanks for the info. I believe I have tracked down and solved the issue. You can download the latest ACF from github and test it out.
Let me know if it solves your issue
Cheers
E
Sorry i try again
I have made a custom taxonomy for my attacments, if i edit the attachments under media i will be presented with a list of checkboxes with the terms of the taxonomy.
Then i have used your plugin ACF with the Gallery addon for a post type i have called shops.
All my shops then have a gallery of products in their catalog but when they use the gallery plugin and click on the edit link on the image represented by af pencil it shows the taxonomy as a textbox.
I would like to have it not as a textbox but as list of checkboxes, radiobuttons or select list.
Because if they just use the textfield they dont get presented with any terms, so they need to know all the terms. This will make a mess in my filter function on the front end.
Hope it is easier to understand now
Thanks
Mats

Hi @rlocke
I think the issue is that the value ‘Cherry’ is not correct. ACF saves the term ID as the value, not the term name.
Changing this to the ID should work.
You can check your wp_postmeta for clarification on the value that is actually saved!
Thanks
E

Hi @jhkerschner
Thanks for the feedback,
I’ll do some testing for the taxonomy pages and conditional logic.
I have recently done some work to the conditional logic functionality. Can you try installing the latest ACF from github and test the issue again?
Thanks
E

Hi @MatsKruger
Sorry, I can’t understand your question.
It is very confusing. Can you re-write it being very clear about your issue?
Thanks
E

Hi @mcaus
It sounds like you want to create a product archive with categories.
I would do this:
1. Create a post type called ‘product’
2. Create a taxonomy called ‘product-category’ and connect it to ‘product’
3. Create a template file from the product archive ‘product-archive’ and create a custom loop that loops through all the categories. Each category should have a thumbnail which you can use ACF for
4. Create a template field for the taxonomy archive ‘taxonomy-product-category’ and allow this to loop through and render out the products in this category
5. Create a template for a sibgle product ‘single-product’ and this renders a single view. You can use ACF to populate field data for this product.
I don’t think you will need the options page for this.
Good luck
Cheers
E
Ok, it works that way:`
$fieldf = get_field_object('hair_color', $taxonomy . '_' . $term->term_id);
$field = get_field('hair_color', $taxonomy . '_' . $term->term_id);
$value = $fieldf['choices'][ $field ];
echo $value`
Thank you so much for your help

Hi @JiveDig
I would use WP taxonomies for this. A taxonomy is very light weight and can quickly be added / edited.
Create each song name / artist name as a taxonomy term (use 2 separate taxonomies)
In short, ACF won’t help you out much on this project. I would jump over to the stack exchange forum for nay further WP help
Good luck
Cheers
E

Thanks for the code snippets. Your code looks perfect so it must be 1 of 2 things:
1. You have a spelling mistake in your field_name ‘anuncio_pavilhao’
2. that you are using get_field in your functions.php file which at the moment ACF is not able to run correctly in.
Are either of these possible?
Thanks
E

Hi @Koko
Are you able to change this to useing a taxonomy for location?
This would make you life many times easier thanks to the native WP checkbox UI.
If this is not possible to change, you will have to create 2 select fields and populate them yourself using some kind of AJAX call to populate the second choice.
Sorry there is no easy way for this at the moment.
Thanks
E
When are you planning to add this feature to the plugin? I’d love to make use of it, and I’m kinda really needing it right now 😛
+1 for this feature to be added.
I’m looking to get a list of all Tags in a Relationship-style of field, where the chosen list of tags can then be reordered, as we can with Posts currently.
Like RichB, the Taxonomy checklist/multiple select only gets me half way there.
I’ve been playing with the code in the link you provided Elliot but I am not having much luck so far.
Fingers crossed this will be added soon!
Tested the current nightly build and the problem still occurs.
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.