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
4
votes
6 answers

How to remove wrapping p tags from acf wysiwyg field string for later custom excerpt processing

I have a WYSIWG field with the advanced custom fields plugin. When i query it with :

the output looks like that:

Worf,…

rkoller
  • 1,424
  • 3
  • 26
  • 39
4
votes
3 answers

acf, getting thumbnail size image from field

I'm using Advanced Custom Fields plugin on my wordpress website. I'm displaying on a page the first image ('photo') of a repeater field ('photos_presse') from children page. here is the php code I'm using.
mmdwc
  • 1,095
  • 6
  • 27
  • 53
4
votes
2 answers

Advanced Custom Fields - If/Else Statement with true/false checkbox

I have added a true/false checkbox using Advanced Custom Fields for Wordpress. I want to be able to select an option which amends the page template. I am adding this option to the Product Category in WooCommerce / Wordpress. I have included this bit…
3
votes
1 answer

Loop through custom WP taxonomy, grab ACF field value for each

I feel like I'm really close to a solution here, I'm just not familiar enough with php or wordpress syntax to see where I'm going wrong. In the footer (used on every page on the site), I'd like to loop through a custom taxonomy I've created. Each…
samseurynck
  • 113
  • 1
  • 10
3
votes
1 answer

POST Request for ACF plugin is not working

I am trying to publish a post in WP using rest api. I need some extra field too. So I have installed ACF plugin to insert extra field. After sending the request it returning 201 (post is created) but extra field value remaining empty(not updating). …
3
votes
1 answer

How to display ACF field after the product name on the cart and order reviews in WooCommerce?

I have Advanced Custom Fields setup for post type on WooCommerce Products. So each product has 1 unique custom field. I'm trying to display the custom field after the product name on the cart and the checkout page and order table…
3
votes
0 answers

How to use ACF fields as attributes in my custom Gutenberg block and keep them up-to-date?

We're slowly migrating our wordpress theme development process over to the Gutenberg editor and I made quit a few custom Gutenberg blocks now, either with the Wordpress Block API or with the ACF Blocks. I try to use the wp core blocks as much as…
3
votes
2 answers

Wordpress how to update ACF field in a custom post type after the post has been saved

I'm trying to set the value of a field in a custom post type right after that post has been created. Here is my code: add_action('acf/save_post', 'set_coach_email'); function set_coach_email( $post_id ){ $posttype = get_post_type($post_id); …
3
votes
1 answer

How to get ACF product fields values in WooCommerce Order Items

I am modifying my shop to show custom fields on WooCommerce order page after the order has been made. My code is inserted into default /themes/mytheme/woocommerce/order/order-details-item.php. This is the part that reads the…
twelvell
  • 257
  • 1
  • 8
  • 19
3
votes
1 answer

Wrap TinyMCE 'table' in div''

Is there a way to wrap a in a div with TinyMCE? Preferably something natively by extending TinyMCE, I know I can get it to work with pure JS. I was attempting to do something like this with no luck. (by following this doc:…
IHIutch
  • 71
  • 1
  • 6
3
votes
0 answers

get_fields is empty after inserting an ACF gutenberg block

we just integrated timber into our acf-gutenberg-block setting, and we love it. ;) There is one thing that doesnt work. Our ACF Blocks have prefilled values like a "dummy" headline. But when a backend user adds a block into the gutenberg view, the…
3
votes
3 answers

WP_Query in wordpress and include ACF in results

I try to fetch all posts from a custom post type in Wordpress and include the advanced custom fields (ACF) in the results as well, in order to generate a JSON file with the data. $query = new WP_Query(array( 'post_type' => 'resources', …
Tasos
  • 7,325
  • 18
  • 83
  • 176
3
votes
0 answers

ACF, Categories and Featured Image for a custom post / relationship on WP REST API

I'm building a Gatsby site that sources from a WP back end with GraphQL. I'm having issues preparing my data to send over through the API. I have a custom post called case studies. These case studies have categories, a featured image and several…
3
votes
2 answers

Get (and display) other posts that match ACF relationship field

I have an ACF relationship field called products. This field is present on the custom post type called resources. In resources, I have three blogs, titled: Blog 1 Blog 2 Blog 3 Blog 1 has the products field set to "Premium". Blog 2 also has this…
3
votes
2 answers

Wordpress: custom post type delete post permanently

So I want my posts in my custom post type deleted permanently instead of moving to trash first. so I found this code online that is supposed to do the trick. But I'm not able to get it to work somehow. The code that I have is as follows. function…
Asta
  • 121
  • 1
  • 14