Questions tagged [advanced-custom-fields]
OFF-TOPIC. Support questions should be asked on the plugin's support page.
1,508 questions
1
vote
0
answers
40
views
Using ACF fields from a Gutenberg block in a load more function [closed]
I have been trying every which way to make my 'load more' work with ACF fields. I have a complex query that works correctly, but I need a 'load more' added. This is where I am. I can load more, but ...
1
vote
2
answers
110
views
Generate list of posts on a page, but fill shortcode values from ACF fields on that page
I have been generating a list of posts from particular categories, that can be embedded within any page using a shortcode:
[random-posts-list cats="my-category, another-category"]
The code ...
0
votes
0
answers
37
views
Building a multisite where ACF Gutenberg blocks can either pull from main site, or if a priority flag is marked, pulls block from subsite
I'm building a Wordpress multisite where there is a parent site, Site A, which will have several subsites, Site X, Y, Z.
Each site will have the same pages with the same page slugs, and almost the ...
0
votes
1
answer
134
views
ACF Custom post type name changing issue
So here is the situation, i have created a CPT (portfolio) with acf and assigned to it a custom taxonomie (category) and posted some content in the CPT and the taxonomie wich was fine.
But then i ...
0
votes
1
answer
45
views
Googlemap not initialising
I have a page here:
URL: https://hscr.com/short-term-rentals-vancouver-2/
Password: vancouvertest
Which has a google map initialisation on it, if you scroll down you'll see there is a blank area on ...
0
votes
0
answers
26
views
Query Custom Post Types on Available Dates
I'm wondering if anyone has a plugin solution or if they can forward me in the right direction.
We currently list holiday rentals on our website and we have the properties set up as custom post types.
...
0
votes
0
answers
135
views
WP get_terms and ACF field
Trying to add terms from another taxonomy to the current term. It seems to work fine when I have multiple values but the get_terms($args) returns 0 when there is only one value.
Here is the setup.
The ...
1
vote
0
answers
81
views
Post Navigation Elementor
I'm using Elementor and ACF on a website and have a custom post type for events. In elementor I have the posts on the archive page set to order by the ACF start date field. When the user clicks the ...
0
votes
1
answer
38
views
Draft standard post by ACF Data picker
I have a custom field named "fecha_borrado". The date is a date picker from Advanced Custom Field.
I have this code but don't work. Maybe i did some wrong?
I added too define('...
1
vote
0
answers
52
views
Display posts in correct month order using single date custom field
I have developed a WP Query that displays posts from a custom post type and taxonomy, and orders them by date using a custom field.
The posts have a single Advanced Custom Fields date picker field ...
0
votes
0
answers
32
views
Why does my custom slug only show in Gutenberg editor after page refresh?
I'm using an acf field to create a custom slug for a post type. Everything works and saves correct in the database. Only the shown value of the link field in the backend is not updated on publish. I ...
0
votes
0
answers
33
views
Show Hide Post Information based on term clicked by user
let me explain my requirements. I have WordPress website and I have created a custom post type reviews. Single post have acf fields which I want to show up depending upon the the term user clicks on ...
10
votes
2
answers
1k
views
Is there a security vulnerability in Advanced Custom Fields related to the SCF fork?
I don't wish to get into the politics going on between WP Engine and Wordpress.org (and I understand there are strong undercurrents to the ACF issue) but in his post Secure Custom Fields Matt ...
2
votes
1
answer
185
views
Date not working correctly
I have made a custom theme and used CPT UI to create Event Post Type and ACF to create Event Date Field. I am using following code to display Remaining Event Days in frontend:
$event_date = strtotime(...
0
votes
1
answer
20
views
Add up all numbers from a WordPress query [closed]
I have the following code
$query = new WP_Query($args);
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post();
$post_id = ...
0
votes
1
answer
208
views
Dynamically Populate Both Labels and Values for ACF Select Field
So a little stuck, I want to dynamically populate an ACF select field based on values from flexible content. I am able to get the labels into the select box, however, the values are in sequential ...
1
vote
1
answer
73
views
PHP Fatal error: Cannot redeclare distance() when making a new block
I created a ACF block. It calculates the distance from the displayed ski resort to the 3 closest ski resorts and displays a summary and is meant to use in a side bar or something.
I have a function ...
0
votes
1
answer
38
views
Wordpress per ACF - permalink is not working
I wrote this code:
<?php
$category_border_color = get_field('category_border_color');
$image = get_field('main_image');
$short_description = get_field('short_description');
$permalink = ...
0
votes
0
answers
35
views
ACF - Updating all posts of CPT when a custom field from options page is updated
I have a custom post type - headstones, that contains pricing information in custom fields:
Cost of Stone
Cost of Carving
Cost Total
Retail Price of Stone
Retail Price of Carving
Retail Total
Of the ...
0
votes
1
answer
443
views
Meta query with ACF relationship field
I have a CPT that contains Employee Bio information. Because we don't want to create accounts in wp_users for everyone, this data is implemented as a "regular" CPT living in wp_posts. Let's ...
0
votes
2
answers
141
views
Made a Custom Post Type using ACF. Via the dashboard I cannot see the view button to see the post [closed]
I've made a Custom Post Type called Activity Providers. In the Wordpress dashboard it shows up as it should in the menu, and I can create them, but the option to view each activity provider is not ...
0
votes
0
answers
35
views
Put ACF function output code the_terms
I would like to put an ACF field in the of my the_terms function, is this possible?
Because I can't figure out how to put it.
<?php $dev = get_field ('my_field', 'option');?>
<?php ...
0
votes
1
answer
103
views
Custom title in a wordpress page edit mode with ACF fields
A couple of images will be easier to describe what I need to do:
Here I am entering a new product's title and description, which is simply a repeater with 2 texts.
When I validate, I get my entry ...
0
votes
2
answers
178
views
How to use meta_query to retrieve posts from multiple custom post type
I am having two custom post type "meet_our_community" and "news"
I have added a checkbox field named 'add_to_meet_our_community' from the acf to 'news' post type.
Now I when tried ...
1
vote
1
answer
461
views
WordPress API V2 - filter and order by ACF field
I have a custom post type called "crowdfunding" which contains two Advanced Custom Fields called campaign_start_date and campaign_end_date (in addition to several others). I'd like to create ...
0
votes
2
answers
60
views
Calculate order end date based on date and number of weeks ACF fields
We have 3 ACF fields added to Woocommerce orders - start date (pick_up_date), number of weeks (number_of_weeks) and end date (end_date)
Start date and number of weeks are manually entered and the ...
0
votes
1
answer
156
views
Redirect to File attached to a Post using ACF
I'm trying to redirect users directly to the URL of the file located in a post using a File field from ACF. Something like:
<?php function redirect_to_acf_file_url() {
$file_url = get_field('...
0
votes
1
answer
91
views
Creating a Single Instance Custom Post Type with Limited Module Options using ACF and WPGraphQL [closed]
Hello WordPress community,
I'm working on a project where I need to create a custom post type using Advanced Custom Fields (ACF) and query it via WPGraphQL to integrate with a Headless Next.js build. ...
1
vote
2
answers
905
views
Generate Post Title From ACF Fields on Custom Post Type
I have tried a few versions of the code to get this working and seem to come up with a couple of errors either way.
I am using ACF for the fields and adding the below code to the themes functions.php ...
1
vote
0
answers
86
views
WordPress pagination error when using ACF CPT rewrite slug & Polylang CPT slug translation
I use WordPress with Polylang PRO and ACF PRO plugins.
Using ACF PRO I've created CPT with post_type 'aktualnosc', with rewrite slug 'aktualnosci' (same slug as page name (with posts list)).
I also ...
0
votes
1
answer
295
views
Advanced Custom Fields - How do I get field values of a group within a group field type
I'm creating a Run Report page for a ski resort. I have created an ACF group calls Runs. Within this ACF group there are a number of ski runs that use the checkbox field with the values 'Day' 'Night' ...
0
votes
0
answers
40
views
Not applying update field (acf) in my plugin
this is my plugin code
<?php
/*
Plugin Name: Unique Auto VIN Fetcher
Description: Fetches vehicle data using VIN from a specified API and fills the data
in custom fields in posts.
Version: 1.0
...
0
votes
1
answer
103
views
Multisite, using switch_to_blog in filter
I am programming a hook for ACF to get a list of posts from another site in a network.
so
switch_to_blog(1);
... do some WP_Query...
...list results in an array ...
restore_current_blog;
in a ...
0
votes
1
answer
116
views
Unable to edit custom post type, editor crashes. What to do?
I have a custom post type, which also has a custom taxonomy. These have been defined via ACF.
Editing posts of this custom post type results in the Wordpress editor crashing. This seems to happen when ...
1
vote
0
answers
98
views
WP_query with ajax filter not working with input fields
I'm having trouble with my query when using ajax to filter the posts.
I have a page where the posts of post type 'activiteiten' are loaded when the start_date custom field has today's date or a date ...
0
votes
0
answers
40
views
How to create advanced custom fields for backend content
Is there a straightforward way to create custom fields for module-based content on WordPress?
Example:
User Creates page
Creates Page content sections through forms
Row 1: Column 1 - Content A ...
0
votes
0
answers
53
views
Plugin question, How to insert a colon in a value box
I would like to be able to insert a colon into my number box. In this case, I would like to put a colon between 15 and 1 instead of the decimal, since it is describing a ratio, but when I do this it ...
0
votes
1
answer
81
views
How to get posts in backbone where a custom field matches a value?
How can I retrieve posts, using backbone, that match a particular custom field value?
My custom fields are created through ACF.
Something like this doesn't work:
var data = {
offset: 0,
...
1
vote
1
answer
74
views
Randomize post list with some posts with specific ACF value in the top 50%
I'm using a plugin that lets me order posts and set some as "sticky" and always on top.
I have the example code below that will randomize all posts except for the sticky posts, they will ...
0
votes
1
answer
339
views
Create WhatsApp URL dynamically using ACF Pro from different fields
WhatsApp has a feature that allows you to start a conversation from a link.
This link will be built like this:
https://wa.me/1XXXXXXXXXX?text=message%20here
Where 1XXXXXXXXXX must be replaced by the ...
1
vote
1
answer
671
views
Replace multiple RichText components in a single block - wp.blockEditor.RichText multiline prop is deprecated
so a week or so ago my hosting provider updated my version of Wordpress (I cannot control this) and on the edit side most of my Gutenberg blocks are broken. I knew this day would come but I was ...
0
votes
1
answer
309
views
Is there a way to add a ACF/metadata field data to a custom post type permalink?
I am confused around how the add_rewrite_rule function works, especially with custom post types.
I have a custom post type books and for each post, I have a ACF field that is called ISBN. Right now, ...
0
votes
1
answer
292
views
get_field for a widget value returns null ACF
I am using `ACF` plugin to add a custom field to my widgets.
After creating the field with the name `mobile_enable`, tried to get the value with the method explained in the ACF docs which is the ...
0
votes
0
answers
89
views
How can I filter records in a custom post type list in the admin based on the ACF field in the post that contains the current user?
I have a custom post type called Projects that includes an ACF field named team_members which uses User as a field type and returns a User Array. I want to filter the post type listing so that the ...
1
vote
0
answers
278
views
How do I add a filter to my custom post type archive page?
I used the guide HERE from acf themselves, but for some reason whenever I attempt to query anything at all in the url I get the "There has been a critical error on this website" error.
$...
0
votes
1
answer
85
views
Cannot get user's ACF data when using a template part in a WP_User_Query
I'm using a template part to repeat the HTML for each result when performing a WP_User_Query to return a list of users. However I am finding that the Advanced Custom Fields data isn't returning.
// ...
1
vote
0
answers
339
views
Add ACF fields to Repeater items when using REST API
I am currently building a Headless site using WordPress as a CMS, coupled with Nuxt 3, bridged with the REST API.
So far, everything’s been great, but I’m struggling with how to retrieve the ACF ...
1
vote
0
answers
354
views
How to add new ACF repeater row after removing all rows using jQuery/Javascript
I am creating a custom ACF Field within a page edit screen which I have added a div container, outside the container is 3 buttons. Add text block, add image and save.
I also have a repeater field (I ...
0
votes
0
answers
655
views
warning: trying to access array offset on value of type bool ACF field image group
I have a problem with an acf function for displaying an image by array.
I can get my image to work well when I upload it to the field associated with it.
On the other hand, when I don't put an image, ...
0
votes
0
answers
108
views
Add "reviewedby" in Wordpress posts
Hello,
I was wondering if there is a way to add "reviewedby" + name (potentially with a blue checkmark) under the author as displayed in the attached example.
Also, I would like users to ...