Questions tagged [advanced-custom-fields]
OFF-TOPIC. Support questions should be asked on the plugin's support page.
1,441
questions
0
votes
1
answer
6
views
acf/validate_save_post vs acf/save_post [closed]
I want to validate a post before to submit.
Is there any differences?
add_action('acf/validate_save_post', 'my_acf_validate_save_post');
function my_acf_validate_save_post() {
// Do validate.
}
0
votes
0
answers
13
views
How To Save Data From Remote APIs To ACF?
I've been attempting to ingest remote data from an api partner into Wordpress. To data I've used wpallimport plugin, but it's quite limited.
How would one connect with a remote api and then save the ...
1
vote
1
answer
25
views
list/consult Taxonomy only for the respective author/creator in dashbboard
I'm trying to filter so that only the creators of the respective categories can edit them.
I created a cat_author meta field and associated it to the taxonomy.
In this way, every taxonomy has an ...
0
votes
1
answer
12
views
comments_where Hook
Is there a similar replacement of the hook posts_where for comments (WP_Comment_Query)?
I need to modify the where clause for a comments query like it is shown in this tutorial (“4. Sub custom field ...
0
votes
0
answers
17
views
Retrieve posts that have a given checkbox value selected with ACF [closed]
I have tried everything, but nothing solves my problem.
This is the code I use to retrieve posts that have the selected value in the checkbox:
$args['meta_query'] = array(
'relation' => 'OR',
...
0
votes
1
answer
4
views
How do I change the site title and tagline in an ACF options page? [closed]
I would like to create a single text field in an options page and upon saving the form, have the site title and tagline update.
0
votes
1
answer
9
views
ACF to select posts not displaying on blog page
I am trying to implement a repeater / post object so I can select posts that I want to displaying on the sidebar. I am using this code:
<?php while ( have_rows('top_posts_repeater')) : the_row(); /...
0
votes
0
answers
20
views
Having a repeating custom field in admin custom post type, what I'd go better with, for DB's sake? ACF repeater or query a different post type?
I have:
A main custom post type - 'Cards' - each post showing its ACF repeater custom field - 'operations' - with the following sub-fields: 'add/remove', 'amount, 'value', 'date'.
Let's say the fully ...
0
votes
1
answer
25
views
How to inherit field value from parent post into in child / sub post
I have created a custom post type, called 'centres'. This CPT is hierarchical, ie, I can create child pages under each custom post.
Centre1
Location1
Contact1
Centre 2
Location2
Contact2
I've ...
0
votes
1
answer
29
views
call ACF gutenberg block like a shortcode? [closed]
I have created a gutenberg block with acf with different field options. See a simple example:
<?php
/** Block Name: spacer **/
// Field Options
$size = get_field('size');
$classes = ['fs-spacer-'...
0
votes
0
answers
7
views
Get ACF taxonomy term and sub-term lists ACF blocks
I want to get list of parents and child terms from ACF field type Taxonomy. This things need to display as ACF blocks. i have tried many things to done this stuffs but but it's not working for me.
...
0
votes
1
answer
17
views
How can I add a shortcode to query Custom Post Type with ACF in Wordpress?
I am building a website for a client, and I needed to build a game release calendar using Custom Post Type and Advanced Custom Fields. Everything is built out, but the last step.
I need to be able to ...
0
votes
1
answer
15
views
Rewrite comment form post ID on submit
I have a WordPress comment form, with a custom field (added with the Advanced Custom Field plugin) where the visitor can chose from a options (these are page IDs). When submitting the form, I want ...
0
votes
0
answers
21
views
Order WP_Query by meta_key priority when 'OR' relation used for multiple meta values
I have a WP_Query that queries posts by an ACF date field AND an ACF true/false field. I am requesting all posts that have a date field value past the current date OR have the true/false field ...
0
votes
0
answers
20
views
How can i show ACF in post excerpts
I am using a custom post type and would like to show Advanced Custom Fields in my blog module (Divi). I think i should go and load that values from ACF in the post excerpts. How should i do this?
I ...
0
votes
1
answer
22
views
ACF: If field contain a specific value, update value in another field programatically
how can I change the value of a field based on the value of another field programatically?
This other field has already a value but I need to replace / update it.
To be more precise:
If the Text Field ...
0
votes
0
answers
5
views
How can I apply an ACF field to a single custom post if it refers to the taxomy of that post type in the rules?
need to hide a div inside custom posts in a given category. I created an ACF True/False field and applied it to the category taxonomy for this post type. But this True/false should work on internal ...
1
vote
1
answer
21
views
Display post in order of ACF checkbox?
I have a custom post type called ‘Skateboards’. Within the custom post type of ‘Skateboards’ , I added three checkboxes (filed type checkbox) with a field name of ‘skateboard_performance’ associated ...
0
votes
0
answers
29
views
ACF field group not showing in page
i've created an ACF field group just for one page, since my clients will need to upload 2 files directly related to that page (it's a page about a basketball team, so they'll have to upload the ...
0
votes
0
answers
23
views
ACF: If field contain a specific value, update value in another field
As I wrote in the title, how can I change the value of a field based on the value of another field programatically?
This other field has already a value but I need to replace / update it.
To be more ...
0
votes
0
answers
42
views
ACF: Update field value based on value of another field
I have some custom posts that lists cars, motorcycles and trucks.
The values in the ACF fileds are automaticaly populated and I cannot change them manually because they come from an external software.
...
1
vote
1
answer
35
views
ACF: replace comma with another sign [closed]
I am using ACF.
I am using this function to display numbers in number fields in this way 1,000.00
// Return ACF Number Fields Formatted with Commas on the Frontend
add_filter('acf/format_value/type=...
0
votes
0
answers
16
views
Foreach loop is unexpectedly outputting an extra empty a tag
I am using a for each loop to output elements on a grid and I am using acf's gallery type to input images.
It is outputting this extra a tag with empty space and no hrefs. See below
Here is my php
&...
0
votes
0
answers
27
views
Getting "Years Only " from ACF Date Picker field to Hidden filed in the fields group
I have a Date Picker field and text field, or hidden field, can I get the year filled up to the text field or hidden field when filling up the date picker filed?
this is for a filtring reason I do ...
0
votes
0
answers
56
views
How to only show ACF field if another block is being used?
I'm developing a tab system on my site and I want to build the contents of the tabs using ACF blocks.
I have a "Tabs" block which handles the titles of the tabs. I have linked the index ...
0
votes
0
answers
12
views
Delete images from media library when user deletes an image from ACF Gallery
When a user deletes an image from the gallery in wp-admin I need it to be deleted from the media library too. I have a function using the acf/update_value hook which works uncorrectly. When a user ...
0
votes
0
answers
30
views
ACF Gut block broke wordpress default style?
When I add a new custom ACF gut block, he broke the default WP style:
After adding a custom block:
Example of ACF block:
acf_register_block_type(array(
'name' => 'rte-...
0
votes
0
answers
11
views
Need to check if user has completed a woo commerce payment
I am newbie at php.
I am trying to check if user has a payment token or some other value that confirms they have made payment.
I want to redirect the page if the payment status is empty 9they have not ...
0
votes
0
answers
21
views
How to create a search form with multiple search fields
I have a client that would like to add a search facility to their site but...
They would like to allow the user to search various different custom fields.
Here's an example of the sort of thing I'm ...
0
votes
0
answers
20
views
What am I missing in this Code Block?
I am using ACF Pro and Oxygen Builder. I have a FG (Repeater) set for a Rooms & Suites FG.
I have several sub_fields to capture attributes of each such hotel room that gets created via its CPT.
...
0
votes
1
answer
35
views
ACF - Retrieve custom taxonomy from a relationship field
I have a custom post type, called prognosis with 3 custom taxonomies, Country, Competition, and Sport, I've also added a few ACF custom fields. I have another custom post type called analysis with an ...
0
votes
0
answers
17
views
How to store checkbox data for individual users?
I am working on a video-course website and I would like to add a checkbox next to each video so that when a student finishes watching the video, they can mark it complete and when they return they ...
1
vote
1
answer
53
views
Thumbnails generated from PDF in the "Media" section - how to show them in theme template?
I have an ACF custom field for "File". It allows users to upload PDF files of some reports.
In the Media section in WP Admin, I can see that the PDF we upload auto-generates the thumbnails.
...
0
votes
0
answers
14
views
How to set a 'page' as parent of a custom post type?
For various reasons, I would like to use a 'page' in preference to an archive page for one of our custom post types and have this be reflected in the permalink structure. I am struggling to find out ...
0
votes
1
answer
20
views
Featured Image and Tags problem
I am very new to PHP and am having an issue with an amazing advanced Wordpress tutorial which showed how to use ACF and functions.php to scrape and import the data directly into my Animal Shelter ...
0
votes
0
answers
33
views
ACF Select Field can't return Array
I want to get the list of selected items. The field is made with ACF, and I query the data with wp-graphql. I also have the wp-graphql ACF addon installed. However, when multiple items are selected, ...
0
votes
0
answers
17
views
ACF: Grid based on field value
I have a “company pages” field group and a template that displays all of the companies in a grid. One of the fields in the “company pages” group is INDUSTRY.
I now want to to be able to sort that “ALL ...
0
votes
0
answers
33
views
Replace the_content with ACF Flexible Content via function
function replace_the_content($content) {
global $post;
// ACF post summary
if (get_field('post_summary')) :
$post_summary = '<h4> ' . get_field('post_summary') . '</h4>';...
0
votes
0
answers
12
views
Multi-layered WP_Query
I'm trying to avoid creating additional custom field for one of the posts, and was wondering if there is a way to query WP DB to retrieve the necessary data.
I have 3 types of posts: Events, Programs ...
0
votes
1
answer
138
views
Merge 2 custom post type posts and taxonomy terms and sort ascending
We have a most recent block where we query a taxonomy for a custom post type and posts from two custom post types. This we do using this code
Full Code
<?php
/**
* Highlights block
*
**/
// ...
0
votes
1
answer
12
views
Keeping and updating ACF and ACF Pro at the same time
I am not sure how far this is relevant on this platform. Actually I am in a situation where I have both ACF (Deactivated) and ACF Pro (Activated) installed at the same time in a single WordPress site.
...
0
votes
0
answers
25
views
Equation input with preview in classic editor
I use WordPress as a headless CMS, and my frontend is made with React. There's no theme or live preview.
I'm looking for a plugin to add/edit and preview equations (LaTeX) in the classic editor.
This ...
0
votes
0
answers
33
views
How to show ACF fields in Gridbuilder custom block
I'm using GridBuilder WP (great plugin, average support) to show a grid of a custom post type. Ultimately, I need to show an ACF taxonomy field, and their support have recommended using one of their ...
0
votes
0
answers
30
views
ACF - Hiding metaboxes through screen settings doesn't work
Hiding ACF metaboxes through screen settings seems to be properly saved in user settings (wp_usermeta.meta_key = 'metaboxhidden_{contentType}):
+--------+-------+----------------------+----------------...
0
votes
0
answers
17
views
How to show related post having same relationship filed under single CPT?
I have registred two CPT.
1= Exam
2= Exam Type
Here i have added relationship filed to exam {1st} CPT. CPT 2 have 20-30 posts.
Now I want show related posts under 1st CPT from same cpt having same ...
0
votes
1
answer
43
views
ACF flexible content block not showing on live site (works locally)
I've made a flexible content section in ACF for a specific category that allows the user to post text and different image galleries onto their post. This all works perfectly whilst I'm on my ...
1
vote
1
answer
20
views
Looking for most performant way to execute several similar WP queries within shortcodes
I have a very data-driven website where each page contains several (5-10) shortcodes, each of which execute WP queries and display the results.
The queries are usually quite similar - I've added 3 ...
0
votes
1
answer
31
views
Add ACF field in a query
I am trying to set category_name of a query using an ACF text field but I am getting all posts instead the post of the category I want.
$category1 = the_field('category1');
$args1=...
0
votes
1
answer
61
views
Oxygen Repeater Advanced Query
Looking for some help with a repeater using an advanced query using ACF.
I've got two custom post types: Product, Vendor
Vendor has a sponsored field.
Product has a relationship field connected to ...
0
votes
0
answers
50
views
Merge PDF files from post custom fields(ACF) into one PDF file and respond back the created PDF file, Wordpress(AJAX Request)
I am using Advanced Custom Fields plugin(free version) for attaching 3 different pdf files to a single post.
After displaying a list of posts on a template, with a button click I am making an AJAX ...