Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [advanced-custom-fields]

**NOTE** Support for this plugin is off-topic. Support questions should be asked on the plugin's support page.

0
votes
1answer
8 views

How do I validate extra pin field on my WordPress login form page?

I have been able to add an extra field to my WordPress login form using the following code inside wp_login.php file, thanks to stackxchange. add_action('login_form','my_added_login_field'); function ...
-3
votes
0answers
14 views

advanced custom fields if field has value show main div more then 10 fields

<div class="prd-overview-list"> <h3>Quick Details</h3> <ul> <?php if( get_field('type') ): ?><li><p>Type:</p> <p><span><?...
0
votes
1answer
12 views

advanced custom fields if field has value show main div

<?php if( get_field('packaging_details','port','lead_time') ): ?> <div class="prd-overview-list"> <h3>Packaging & Delivery</h3> <ul> <?php if( ...
0
votes
0answers
11 views

Advanced Custom Fields add custom fields in user meta table after user is created [on hold]

How do I create programmatically using Advanced Custom Fields Pro on a new user new entries for profile data over ACF? Getting to the point of creating a new user by a script I want to be able to ...
0
votes
0answers
13 views

update ACF user metas programmatically

I use woocommerce where I have a custom hidden field on checkout page which is populated by a survey. Each user has some user metas created over ACF and I would like to add this hidden data to ACF. ...
0
votes
0answers
4 views

WP meta query: multiple date compares if datepicker is not null

I am trying to build a meta_query which will return all posts that have at least one of their datepicker value greater than today. If the value of the datepicker is null then I don't want to be ...
0
votes
1answer
22 views

Validate custom fields before save using WordPress Rest API

I want to add custom validation to post(custom post type) before it save into the WordPress. I am using the Rest API to insert the post to custom post type. What I need is the fields which I created ...
0
votes
1answer
17 views

Include fields by Advanced Custom Fields plugin in v2 API response

I'm using WP5 with the Advanced Custom Fields plugin. How to include custom fields added by this plugin in the REST API? Update: I'd like to add all of these custom fields to Page.
0
votes
0answers
8 views

How to dynamically call the alt text within WordPress? [duplicate]

I have this repeater field calling to an image but I also need to add the alt attribute that I added to each specific media file. Does anyone know how to do this? <img src="<?php ...
0
votes
1answer
25 views

ACF relationship field outputting unpublished content

I have a relationship field that outputs posts from a custom post type. However, if I unpublish one of those posts, it still shows in the outputted code. I'm aware it's possible to set the fields to ...
0
votes
0answers
34 views

ACF: Disable repeater field in user profile for non admin users [closed]

In the user profile page I have a added a repeater ACF with 2 subfields (select and datepicker). I want this field to be disabled if the user is not administrator. So administrators can edit this ...
1
vote
1answer
43 views

How to replace custom post type slug with an ACF value?

I have a drop down select type field in Advanced Custom Fields. The values are Video and Image. I want to replace the Custom post type slug. Currently, it is video. I want to change mysite.com/...
0
votes
1answer
18 views

Display a colour of custom taxonomy on the page

I've created a custom taxonomy called "colour" // Taxonomy add_action( 'init', 'create_colour_taxonomy' ); function create_colour _taxonomy() { $labels = array( 'name' ...
0
votes
0answers
17 views

Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop

I'm aware there are already answers regarding this question (Insert html after certain amount of posts?). But I haven't managed to find a solutions to my specific problem. The post linked above rely's ...
0
votes
0answers
9 views

JSON ACF custom field type [duplicate]

I was wondering how can you make a new custom field type on acf and get JSON data from the url and when it got the data, put them on the same fields of ACF fields. Like these Mockup pictures: It ...
0
votes
0answers
32 views

Getting data from JSON - ACF Plugin

Is there anyway to get data for ACF fields from JSON? I mean for example you have a new post where you have your ACF fields there, how can you fill those fields by giving the JSON url to one of the ...
0
votes
0answers
24 views

ACF in Woocommerce edit account page

I have created a field group and i've set to "Show this field group if user form is equal to All". I have a select field and a text field. In woocommerce registration page this field group displays ...
0
votes
1answer
25 views

using wordpress acf shortcods in tables goes outside the table

I want to put some audio files in a html table using wordpress default [audio] shortcode and using ACF to take the url of song. because of using two nested shortcode does not renderrd in wordpress, I ...
0
votes
1answer
49 views

ACF for audio url in wordpress audio shortcode

This WordPress shortcode plays an audio file for you and works great: [audio src="http://XXX.mp3"] In a specific post or page ,I want to give it the url of song using Advanced Custom filed (ACF) ...
0
votes
1answer
20 views

ACF Field, hide taxonomy title and image when no nothing selected in post

I have added a custom taxonomy image through ACF. My code is as follows. <?php global $post; $tax = 'directory_features'; $terms = get_the_terms($post,$tax); foreach( $terms as $...
-1
votes
1answer
27 views

ACF Maps admin error: “For development purposes only” even after supplying api key

This issue is occurring even when I tried registering the key via various actions and filters. Fails Method 1: function my_acf_init() { acf_update_setting('google_api_key', 'xxx'); } ...
0
votes
1answer
41 views

Download PDF after CF7 form submission

I'm working on a client's build, and I'd like to change as little as possible. I'm not too familiar with all this, my apologies - I'll try to show where I'm at. The client wants a form submission to ...
0
votes
1answer
34 views

Display custom image field in user profile

I am trying to display user info from acf so far the normal text, radio and select and date fields display if I use the following: <?php $current_user = wp_get_current_user(); echo $current_user-&...
1
vote
2answers
41 views

Modals using loops and ACF [on hold]

I am trying to make a page that queries every post of a specific category ("attractions"). I have been able to get the posts successfully, I just need to make the modals work. I have made a button ...
0
votes
1answer
11 views

html element to separate php variable strings - ACF datepicker

i am using ACF to display an internationalized date with this code : <?php $dateformatstring = "l j F Y"; $unixtimestamp = strtotime(get_field('date')); ?> <?php echo date_i18n($...
0
votes
0answers
26 views

Set custom form limit-entries Gravity Forms

i am trying to limit a Gravity Form in my WordPress project by a custom field. This field, which is an ACF field like others on the same page, only calls a number. I am trying to overwrite the field "...
0
votes
1answer
52 views

WordPress Gutenberg, update post content programmatically

I have been starting to testing out Gutenberg editor with both ACF and custom blocks. And I have been looking around to solve my problem but I couldn't find anything about this topic (Maybe my google ...
0
votes
0answers
13 views

Query Custom Post Type by Custom Field ID

I'm not sure if i've just been staring at this too long. To give some general info, I am trying to query custom post types based off another CPT's custom fields. Let me explain. I have a custom post ...
1
vote
2answers
34 views

Same ACF on two different pages

I've made quite an extensive page.php using ACF-repeaters and the flexible content module (1000+ lines of code). The code is getting really spaghetti-like, and I'm not sure how to structure it so it's ...
0
votes
1answer
20 views

Change post value in WordPress

How change existing value to new and keep data ? I changed the name in ACF and now my new data is not updated $post_desc = get_post_meta(get_the_ID(), 'post_desc', true); $post_id = get_the_ID(); $...
0
votes
0answers
26 views

How to query wordpress with array of meta_values?

i have an array of meta values of an unknown length and i'm trying to query for posts that contain them. The type of meta value is the checkbox type. So in ACF this is a list of 10 different ...
0
votes
1answer
25 views

ACF background-color per post in a WordPress loop

I have the following loop in WordPress: <div class="container"> <?php $news = array( 'post_type' => 'post', 'category_name' => 'angebote', 'order' =...
0
votes
0answers
12 views

RSS Feed shows Advanced Custom Field posts

If i open my websites RSS feed, i get all the Advanced Custom Fields field groups listed as well. How can this happen? Feed-URL: https://asiastreetfood.com/feed/ Example: <title>Teaser</...
0
votes
1answer
26 views

show only first element from a type with acf

i want to show only the first element of the "type" and not all elements which have the type "payment-services". How can i do that? Hope somebody can help me... <?php if( have_rows('events', 4127)...
0
votes
1answer
19 views

Will downloading a page builder plugin delete my existing data?

I had a website developer build my website. Now I want to add content myself. Will WPBakery Page Builder be compatible? If I activate the plugin will all my existing data be erased?
0
votes
1answer
36 views

wp_split_shared_term_batch messing up upgraded ACF 5 data

After upgrading Wordpress and associated plugins to the latest version on a dev server and migrating the source files and database to the production server, the data from ACF is different. prod and ...
0
votes
0answers
6 views

Add Field Group to Posts if their Category has a specific meta value

I have an ACF field in category that marks it as gallery or normal category. What can I do in the system/admin so that any post that I add under a gallery category would become a type=gallery post? ...
0
votes
1answer
23 views

Get an advanced custom field after post publish

After I publish a post I want to get a custom field from the plugin advanced custom fields and store it inside a database. tried this: function call_after_post_publish($post_id, $post) { $...
0
votes
0answers
21 views

Query multiple meta_keys with the same value

I would like to search multiple fields with the same value. For example: can "accounting" be found in the the following fields Services1, Services2, Services3, Services 4. And the url passing the ...
1
vote
0answers
17 views

ACF From & To Date Validations

I have a custom post type 'event' having categories 'conference', 'seminars', and 'meetings' which have a custom field start_date and end_date to define a date for the event. When one of the Event ...
0
votes
2answers
25 views

Can I link to content dynamically from a page to a new page?

I am new to Wordpress dev, and I have a page that loops through some custom fields(repeater) of people. I'd like each subfield link to go to another page that has more info from that person on the ...
0
votes
1answer
37 views

WebP Fallback for Inline Background Image in Style Attribute

I have developed a theme which has a custom post type called projects. On single project pages there is a parallax style section with a high quality scrolling background image. I am using a custom ...
-2
votes
1answer
28 views

How do I convert an ACF field from a string to an integer?

The client will be entering information for the year a report was produced (eg. 2010). I want to take that information and calculate if it was made in the last 3 years so I can display it in a 'recent ...
0
votes
0answers
28 views

Where have I gone wrong getting a post-type to show up as relational to another post-type?

I feel this has a simple answer but I assure you I did the due diligence. I feel like I followed documentation to the letter. I have found similar issues but none with a solution to my problem. I am ...
0
votes
1answer
55 views

ACF: Updating gallery field doesn't work in backend

I have tried to update a gallery field and the images shows up in frontend but not the backend. // I have also tried to use the ACF field name like $field = 'field_xxxxxxxxxxxxx'; $field = 'images'; ...
0
votes
0answers
16 views

How to use custom fields to search for the specific posts?

My intention is to build a website with places/attractions (as posts) I would like to visit i the future. Something like “extended” Bucket list. :) I created couple categories, enter couple posts… ...
0
votes
1answer
36 views

Retrive acf fields in publish_post action for wp_mail

I have a custom post type called "Envios". In it I've created a Custom Meta box which allows to select users and posts. When one of this custom post types is published it sends an email to the ...
0
votes
0answers
26 views

CPT Loop filtered for buddypress user ID or ACF user relationship field

I've got the following code displaying a post loop for a CPT "gigs" on a buddypress profile under a custom tab (code not shown). In my buddypress install, I have both employers and employees. The ...
0
votes
0answers
27 views

ACF Repeater and Sort

In frontend page outputed ACF Repeater content and I need add dropdown in page frontend with name and date, for sorting for ACF Repeater content.
0
votes
1answer
31 views

List events by month

I am working on a WordPress site consisting of a custom post type called "events". Each "event" consists of a custom field called "event date". I'd like to organize all the "events" by months based on ...