Questions tagged [advanced-custom-fields]

Advanced Custom Fields is a free WordPress plugin which acts as a GUI layer for custom fields. Custom fields are native to WP and appear on pages, posts and custom post types, however the native custom field interface is not very user friendly. ACF uses field groups to attach fields to edit screens.

Advanced Custom Fields is a free WordPress plugin which acts as a GUI layer for custom fields. Custom fields are native to WP and appear on pages, posts and custom post types, however, the native custom field interface is not very user-friendly. ACF uses field groups to attach fields to edit screens.

More information and good documentation are available on the official website. The plugin can be downloaded from the WordPress plugin repository or installed from within the WordPress admin.

Useful Links

4522 questions
3
votes
0 answers

How to add file types to the WordPress defualt file upload array

I'm working to process 3D models through a custom WordPress theme via the Advanced Custom Fields plugin (Field Type: File). The model has been saved as a .glb, which is not included within the default array of accepted file formats. I have processed…
idk
  • 23
  • 1
  • 10
3
votes
1 answer

Using ACF Checkbox Field in a custom post type to filter the results of a different custom post type

I have a single page that is looping through (custom post type 1). Nested inside of (custom post type 1) I have another loop for (custom post type 2). The goal is to have ACF Checkbox checkable in (custom post type 1) that filters the results for…
Zaperela
  • 33
  • 7
3
votes
1 answer

How to filter WP_Query results by the custom field of a related post?

I have two post types: Venues Reviews The Venues Post Type contains the following ACF custom fields: Region Sub Region The Reviews Post Type contains one ACF custom field: Venue (which is Post Object - Select Field) I need to display all…
John Garcia
  • 58
  • 1
  • 10
3
votes
1 answer

Display product ACF field value in Woocommerce transaction emails

Is it possible to have a custom field (created using ACF) next to each item in Woocommerce transaction details? I have a field called ‘shpng’ which contains the shipping date, and it is changed daily from syncsd import file and ends up in the…
3
votes
1 answer

Display product custom fields in cart next to each item name in Woocommerce

I have a store where each product has different delivery date. I have this date stored in a custom field called shpng using ACF. What I'm trying to achieve is to display appropriate field next to each product in cart. What I tried so far is that I…
Wed
  • 323
  • 1
  • 9
  • 20
3
votes
1 answer

Dynamically populating ACF field works with select - but not with select2

I have a select field $("#country") in a ACF form on Wordpress backend which triggers the values for a second select field $("#city"). It's a typical Country/City relationship with custom values. The script is enqueued, the change event is triggered…
3
votes
1 answer

WordPress Advanced Custom Field gallery doesn't return an array

I have ACF Plugin installed and I have a gallery filed in my post. I've tried all these docs but still getting the error : Invalid argument supplied for `foreach()` this happens because the input of the for each is not an array! Do you have any…
Afsanefda
  • 3,069
  • 6
  • 36
  • 76
3
votes
2 answers

Wordpress Query Attachments with ACF field

I'm trying to return all the images within the media library that have a custom field with the value of True. For some reason nothing is being returned, this is what I have so far: function showPainted() { $query_images_args = array( …
WebDevB
  • 492
  • 2
  • 7
  • 25
3
votes
1 answer

ACF repeater field with multiple subfields checked by today date

I have a custom field (repeater) called "today". In it, i have a "choose the calendar date" subfield. On a product (woocommerce) i've added 1, 2, 3 or more dates. The return date its like dd/mm and I get the today date to compare with like…
OzZie
  • 523
  • 9
  • 21
3
votes
1 answer

WordPress ACF Save Post function, need it only to fire when the page saved is custom post type. Or, if field is present?

I am trying to manipulate the my_acf_save_post function to do some maths and update a field with the resulting number. This part is working, the fields full_market_price and example_price are used to work out calculated_price. I did this some days…
3
votes
0 answers

Column sorting for taxonomy admin table using Advanced Custom Fields

I'm trying to get my admin columns on edit-tags.php to be sortable by ACF field value, but I'm missing something. I can click the column heading to sort the column, but it only sorts the table by tag name and not the ACF field value in the column.…
jtomeck
  • 169
  • 1
  • 12
3
votes
1 answer

WordPress query posts by ACF

UPDATE - SOLVED Okay so I have three custom post types 'courses', 'modules' and 'results'. These post types are set up with a number of ACF (Advanced Custom Fields). I'm trying to query the 'results' CPT based on their ACF's using 'meta_query'. The…
Tom Smith
  • 51
  • 6
3
votes
1 answer

Query on a ACF repeater field

I would like to query an ACF repeater field. I've a repeater field called Library (in a CPT called Book) and, in this repeater, I have a relation field called Library (that is connected to an other custom post type called Library). It is this field…
Thomsath
  • 157
  • 1
  • 3
  • 13
3
votes
2 answers

Sorting a repeater field from Advanced Custom Fields in PHP and Timber/Twig

I'm trying to sort the output of a repeater field from the WordPress plugin Advanced Custom Fields (ACF) using the WordPress Timber plugin implementation of Twig 1.34. The basic PHP example to sort from ACF below is from…
BlueDogRanch
  • 721
  • 1
  • 16
  • 43
3
votes
1 answer

Order by two meta ACF Fields in Wordpress

I try sorting products (no Woocommerce, but created by custom post_type) in my site by price. I have two Advanced Custom Fields = price and price_sale. I need result like this:   1999$ 2222$ (price_sale) 4000$ 3200$ (price_sale) 3600$ 3500$ I…
Plikard
  • 179
  • 7