Title: Adding category selection
Last modified: June 8, 2020

---

# Adding category selection

 *  Resolved [rstackj](https://wordpress.org/support/users/rstackj/)
 * (@rstackj)
 * [6 years ago](https://wordpress.org/support/topic/adding-category-selection/)
 * Hey guys,
 * Is there a way to add a category dropdown to let users directly select the fitting
   category?
 * Same with the featured image. As I can not restrict the file types that can be
   uploaded to the featured image with the standard functionality of this plugin,
   is there any way to use a custom acf file upload field and set this as the featured
   image?
 * Thanks for your assistance!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Shabti Kaplan](https://wordpress.org/support/users/shabti/)
 * (@shabti)
 * [6 years ago](https://wordpress.org/support/topic/adding-category-selection/#post-12952226)
 * Yes
 * Create an ACF field, choose type = taxonomy, taxonomy = category, turn on the
   save terms and load terms settings, and add it to your form. Then create an image
   field and turn on the set as featured image setting and add it to your form
 *  Thread Starter [rstackj](https://wordpress.org/support/users/rstackj/)
 * (@rstackj)
 * [6 years ago](https://wordpress.org/support/topic/adding-category-selection/#post-12952241)
 * Thanks Shabti!
 * While this works to some extends it doesn’t fully fit my needs.
    For example 
   I can’t restrict the categories (there are some I dont want users to be able 
   to add a post to).
 * I guess there’s no premade solution for that?
 * Thanks for your assistance!
    -  This reply was modified 6 years ago by [rstackj](https://wordpress.org/support/users/rstackj/).
 *  Plugin Author [Shabti Kaplan](https://wordpress.org/support/users/shabti/)
 * (@shabti)
 * [6 years ago](https://wordpress.org/support/topic/adding-category-selection/#post-12952265)
 * For the dropdown, set Appearance to “multi select”
 * To restrict categories, Here is a piece of code you can drop into your functions.
   php in your child theme. In this example I am showing only categories who’s parent
   category has the ID of 18:
 *     ```
       add_filter('acf/fields/taxonomy/query/name=name_of_your_field', 'restrict_field_taxonomy_query', 10, 3);
       function restrict_field_taxonomy_query( $args, $field, $post_id ) {
   
           $args[ 'parent' ] = 18;
   
           // Order by most used.
           $args[ 'include' ] = [ 18 ];
   
           return $args;
       }
       ```
   
 *  Thread Starter [rstackj](https://wordpress.org/support/users/rstackj/)
 * (@rstackj)
 * [6 years ago](https://wordpress.org/support/topic/adding-category-selection/#post-12952314)
 * Work’s flawlessly.
 * Thank’s for providing this kind of support in your free time!
    -  This reply was modified 6 years ago by [rstackj](https://wordpress.org/support/users/rstackj/).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Adding category selection’ is closed to new replies.

 * ![](https://ps.w.org/acf-frontend-form-element/assets/icon-128x128.png?rev=2305398)
 * [Frontend Admin by DynamiApps](https://wordpress.org/plugins/acf-frontend-form-element/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-frontend-form-element/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-frontend-form-element/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-frontend-form-element/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-frontend-form-element/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-frontend-form-element/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [rstackj](https://wordpress.org/support/users/rstackj/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/adding-category-selection/#post-12952314)
 * Status: resolved