Questions tagged [advanced-custom-fields]

OFF-TOPIC. Support questions should be asked on the plugin's support page.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

Run a function when a custom post is update?

There is a custom post type. Each post has a repeater field. When a post is updated, I need to get a value from the repeater field and insert it into a custom table in the WordPress database. To do ...
0
votes
0answers
5 views

ACF Field on CPT Slug

I am a new user with acf and cpt. I need to create a custom slug with an acf field like this: mysite.com/cpt_title_slug/acf_field and if possible tell me the file that I need edit, like functions.php ...
0
votes
0answers
4 views

How to display WooCoommerce products list using shortcode but show only products with checked ACF checkbox field

How to display WooCoommerce products list using shortcode but show only products with checked ACF checkbox field in Single product editor? if(get_field('acf_custom')) : $checked = get_field('...
0
votes
0answers
7 views

How to attach images to current post being edited with acf custom field

I am using ACF, NOT the pro version, and I also have a plugin called ACF Photo Gallery Field that I am using to make user albums. I used CPT UI to make the custom post type "Albums" and ...
0
votes
0answers
16 views

CPT Adding points on a ranking

I'm new to wordpress and php but trying to improve. I've already done my relevant search but I think I'm also lacking concepts. I have two CustomPosts cyclist and dateRace and i want to do is two ...
1
vote
0answers
17 views

Matching Chapters to a Custom posts [closed]

Im beginner in WordPress ... I have a Custom post type (using CPT UI plugin) called Stories which contain fields (using ACF plugin) to fill up story general info including the title , synopsis , ...
1
vote
0answers
22 views

CPT Loop with ACF and passing ID between Loops

I have a staging site at: https://tozsdeforum.ethermedia.hu/ Near the top of the page, we have a "Kiemelt Hirek" section. In this section, there are five loops in play: IF (pos1 == true) {...
0
votes
0answers
9 views

Best way to figure out in code if I am in a new post or exiting post

I am using ACF and and ACFBuilder to create all the fields for my content post. The code that creates the field is hooked to the acf/init action. When I am creating and adding these fields, I need to ...
0
votes
0answers
10 views

get_posts filter meta_query using ACF Checkbox

I have a checkbox field for a custom_post_type called distributors. I am using get_posts and meta_query to filter the posts by the region checked. Each post has a value of canada or usa. In my code I ...
0
votes
0answers
18 views

Blank Page after submit ACF form [closed]

I have a problem with a form made with ACF : When I press the submit button, the page refreshes and becomes blank. The data entered in the form works and the custom post is well created. I took care ...
0
votes
2answers
29 views

URL through custom field returning null

I have added an image through advanced custom field. I want to retrieve image URL. I have tried with following code. It is returning null. $url = get_field('aboutus_img','aboutus'); aboutus_img = ...
0
votes
0answers
11 views

Populate field choices with wp_insert_post

I have a function which is called when I insert a new post. Inside this function I have an array with some data. I have also registered a acf select field. I am trying to update the acf field’s ...
1
vote
0answers
9 views

Elementor custom Query with ACF fields to show matching woocommerce products custom fields

I am trying to show custom fields of some products using elementor custom query. The products are coming just fine. But they have usage custom fields matching custom conditions. Have a look at this ...
0
votes
0answers
19 views

new custom filed not showing in taxonomy

I want to add a new ACF filed to my taxonomy page, but the text isnt appearing. I have tried <?php the_field('extra_text');?> <?php the_sub_field( 'extra_text' ); ?> but neither one work. ...
0
votes
0answers
20 views

How to display acf repeater in tag archive page?

I want to show some repeater fields on tag archive page. with this code I can display the simple text fields of acf: $term = get_queried_object(); $meta = get_field('test', $term); but when want to ...
1
vote
0answers
56 views

Advanced Custom Fields displaying on tag pages

I have edited Advanced Custom Fields before but never set anything up from scratch, always relied on developers. But I'm wanting to do a very specific thing and I was hoping I could do it by myself. I ...
0
votes
1answer
14 views

Filter result of Custom Post Type using meta_query with ACF

Im using a custom post type named property to list some houses and flats. In this cpt, I have multiple custom fields from Advanced Custom Fields plugin, such as localization, price, rooms and so on. ...
0
votes
0answers
14 views

Update a text field in a block when saving a post?

I'm updating my theme to work with Gutenberg and I'm having a problem updating a text field in a block when saving a post. In my old theme, I had a function that updated a text field in a metabox when ...
0
votes
0answers
13 views

Sort users list (admin area) by ACF post object/relationship title (not by ID)

I have custom fields for users for example "City". And "City" is a custom post type and in ACF it's using for users as a Relationship/Post object. And if in Users page sort by City ...
0
votes
0answers
34 views

building filtering system

I have a custom 'pre_get_posts' function, that attaches meta_query: function my_pre_get_posts($query) { $query_filters = array( 'color' => 'color', 'size' => 'size', 'type' ...
0
votes
0answers
13 views

Set ACF on order during checkout

I’m trying to populate a field on an order with options set by the user during checkout, on our checkout form. function populate_custom_field_value( $order_id ) { if ( ! empty( $_POST['...
0
votes
0answers
14 views

Register ACF date field via PHP

I am using the ACF plugin and I register the custom fields via php. So far I have followed the documentation and I am using this code: acf_add_local_field_group(array( 'key' => 'group_1', 'title' =&...
0
votes
0answers
46 views

REST API: upload media with advanced custom fields (ACF)

Aim I am trying to upload media via the REST API. I have successfully got it working, except for with the ACF data. Problem The media uploads successfully, but the acf fields are blank. Code const ...
0
votes
1answer
23 views

custom fields not displaying on wordpress site

So I have all the fields created for the home page and I have fields created for (icons, contact form and etc...). I am having trouble displaying the contact form on my page. Like the field is done. I ...
0
votes
0answers
26 views

Fancybox3 ACF repeater. URL strip out from the caption field

The gallery works correct as it should but every time that I had a link/url on the caption field it breaks the gallery. Surely should be something around here .html(); thats is filtering the html tags....
0
votes
2answers
45 views

Get users based on month ACF datepicker field

I have an ACF field 'date_of_birth' which stores the user's birthday, examples: 20201226, 20151225, 19980701 Goal: get all users which have their birthday this month, or next month. I currently have ...
0
votes
0answers
41 views

How to display only the parent owner of an attachment pdf file (using AC and ElasticPress)

I have a CPT (using ACF fields), that have a title, some other taxonomies, and a pdf attached file (it's also an attachment file because I need that Elasticpress search in it). When I do a search, ...
0
votes
1answer
40 views

How to display posts with plugin (advanced custom fields) field groups?

I have a php/wordpress code (present inside abc.php file) as shown below which displays images of particular size. php/wordpress: <ul id="list-thumbs" class="list-grid"> ...
0
votes
1answer
57 views

how make file upload field through custom field

I am trying to make file upload field in Advance custom field plugin and I find many reference code on ACF 'https://www.advancedcustomfields.com/resources/file/', stack overflow, stack exchange ...
0
votes
1answer
26 views

ACF: How can I publish values of ACF fields in a loop while using wp_query?

I'm using ACF to add fields to a custom post type. I've created an instance of WP_Query to set up a loop. Within the loop I can publish the standard fields using the_title() and the_content(). However,...
0
votes
1answer
13 views

Wordpress - display relationship between blog posts and custom posts

I created through ACF a relationship between blog posts and the custom post type, which contains employee profiles. Through the relationship, I am able to display links to the employee's profile, who ...
1
vote
0answers
46 views

Saving an array of dynamic repeater data as post_meta

Looking for some Wordpress specific PHP help. I'm making a time sheet with employees listed and in/out for everyday of the week. I am pulling an ACF repeater row of employees from another page that ...
0
votes
1answer
27 views

I cannot get an Advanced Custom Field code snippet to work - and ACF support say it should work

I am trying to get the below action to display on an archive page on my site via Code Snippets: add_action( 'woocommerce_after_shop_loop', 'test_text', 42); function test_text() { the_field('...
0
votes
1answer
36 views

How can I force Dynamic CSS via ACF values to update on page load?

I'm trying to dynamically change the background color of a post on scroll to colors set in post options via an ACF color picker. I was able to source enough code examples to get it working (I thought) ...
0
votes
0answers
23 views

Show all entries from an ACF Field

I have used ACF Pro fairly successfully thanks to these forums and I am back once again for help as I am clearly not a programmer! I created a new WYSIWYG field and added it to my Custom Post Type. I ...
0
votes
0answers
14 views

Refresh (Update) all posts meta without changing any data

I use ACF plugin. Today all my posts look wrong until i manually click "Update" on the post editor. How can i simulate clicking the Update for all posts? Bulk editor update doesn't refresh ...
0
votes
1answer
59 views

How to update an image attachment's alt text from a custom field when saving a post?

I created a block that has an image field and three text boxes: a textfield for the image alt, a text area for the description and another text field that was created in ACF to allow for photo credits ...
0
votes
1answer
34 views

Can set_post_thumbnail be used to remove a thumbnail?

I have a way to set a thumbnail for a post if a checkbox is selected or not. The problem I'm having is if the checkbox is selected and then unselected, how do you delete the featured image that was ...
0
votes
0answers
26 views

ACF - Compare Products Table Layout - First Column to show common fields

I have created a product comparison table. Currently all the selected products show up in separate columns. I would like the first column to show common header and rest of the column to only show the ...
0
votes
2answers
16 views

How Do I Use a ACF Custom Field To Add A Slider ID?

soliloquy( the_field( 'slider' ) ); This is my code to add the ID for a slider from a ACF number field to a slider function call however it outputs the ID and doesn't execute the soliloquy function. ...
0
votes
0answers
56 views

ACF: How to programmatically Update Flexible Content Field?

I want to be able to create sub fields inside a flexible content field. My setting is this one: menu_item_field is a flexible content field that contains: 1.1 menu_item_parent (text) 1.2 ...
0
votes
1answer
15 views

ACF Field value in wordpress login message filter

I am trying to add a custom message after the WordPress logo on the WordPress login form, I am using the ACF field on the home page to echo the value on the WordPress login page, I have mentioned the ...
0
votes
1answer
17 views

ACF - Eliminate unnecessary data and print

In ACF, the_field('battery'); outputs as follows : Battery : Sony Rechargeable Ni-MH 2200 mAh battery or Battery : Energizer AA Rechargeable Batteries 2300 mAh NiMH How can i achieve this (showing ...
0
votes
1answer
33 views

ACF - Pick first or second value from comma separated values

Everyone, I have just started using ACF and mostly using feature to show data uploaded from csv file. Everything is working fine. But in some fields i have data in the form of comma separated values ...
0
votes
1answer
45 views

Dynamically fill a post custom field with post publish date

I created a custom field using Advanced Custom Fields (but I think ACF is optional) and I want him to dynamically fill the publish post date when I publish a post. Example : If I publish a post today, ...
0
votes
1answer
46 views

How to retrieve a Menu Name by Menu Location with ACF fields

What WordPress function can be used to retrieve a Menu Name using the Menu Location as parameter?
-1
votes
1answer
77 views

How to search pdf attachment?

I am using advanced custom fields to create a custom field. I created a custom field called upload pdf. I can attach the pdf file using this field and the field type is File. Suppose there is a ...
0
votes
0answers
13 views

Wordpress ACF passing a variable as a value into args array

I'm trying to create a dynamic posts layout. In the backend, I have a field where I enter the slug of the post collection I want to pass in. The $subfield value is recipe. For some reason, when I ...
0
votes
0answers
22 views

Is it okay to use an ACF field to store a password for a protected area of a page?

I was wondering how secure it is to use a simple ACF text field on a page to store a password for a certain area of content on the page? So the user would have to enter in a password in an input field ...
0
votes
0answers
18 views

Retrieve repeater sub field (image) from an Options Page - ACF

I have a similar issue -- I made an ACF called Icon (post id is 348) and linked it to my Options Page called School Settings Inside of Icon, I have a field called School with a name (school_header) ...

1
2 3 4 5
27