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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

1
vote
0answers
11 views

Bulk-Update Custom Posts

I have the following code in my functions.php file that I'm using to create a custom meta_key called 'spec_wp' (which is based on the value of an ACF repeater): add_filter('acf/save_post', '...
-1
votes
1answer
26 views

ACF + WPML: How to translate date fields?

I'm trying to translate the month name outputted by an ACF date field. How do I get the Spanish versions of those month names? Here's an example of my code: $start_date = get_field('start_date'); $...
2
votes
0answers
58 views

Linking three taxonomies with ACF

I'm creating a product finder using a CPT called "Products", which is already used for displaying products separately on the site. The product finder is based on a answer and question idea, where the ...
1
vote
0answers
14 views

How to remove the inline styles from the content of a WYSIWYG editor field at the time of saving the post?

I am using the WYSIWYG editor as a custom field using ACF plugin to insert a custom table in the field. As a data, the table needed is simply the HTML Markup of it only, only attributes specific to ...
3
votes
3answers
82 views
+50

Front end form to create a custom post with preview

how can i achieve a front end form with preview option to create custom post based on the input? I want it done without any plugin. A simple example will help a lot. This is not a ACF question but ...
-1
votes
2answers
55 views

meta_query for an ACF checkbox field don't works correctly

I got a problem with value = 0 for meta_query checkbox field: $args = [ 'post_type' => 'post', 'post_status' => 'publish', '...
0
votes
1answer
24 views

Use ACF select field to add a class to div inside a flexible content layout

I have built a simple page builder using ACF Pro flexible content fields. I want the user to be able to choose a background colour for the section using a radio button selector. I have set up the ACF ...
-1
votes
2answers
15 views

Advanced Custom Fields with before / after attribute

I am trying to display an alternative title on my home and archive pages created with Advanced Custom Fields. The original code is the following: <?php the_title( sprintf( '<h2 class="entry-...
1
vote
1answer
43 views

How to create an array for a CPT post ID to use in an IF/WHILE statement

I am using ACF and I am trying to do the following on a page Create an array of the custom post type "Services" post IDs Check if the array has at least 1 post ID If so, for each post ID, display: &...
0
votes
2answers
28 views

Strip characters, Including spaces, for tel: link

I'm trying to create a proper 'tel:' link for phone numbers that are added in an ACF text field. So I'm just trying to strip extraneous characters, but the spaces are causing a problem. Existing code:...
-1
votes
0answers
26 views

Wordpress ACF - Repeater with a select option as sub field [closed]

OK so hands up I have never created a select option as a sub-field before and its driving me nuts. I am building a bootstrap theme and the purpose of the code I will add is to generate a service panel ...
0
votes
1answer
25 views

Do comparision after updates hooks of acf-fields?

I have this code: public function init() { add_filter('acf/update_value/name=bookitall_fromdate', array($this, 'check_bookingdates' ), 10, 3); add_filter('acf/update_value/name=...
0
votes
0answers
19 views

How to show ACF group only if a product specific category is selected [closed]

On my WooCom product page. I would like to show an ACF field group (called "screen specs.") only if a user ticks the product category "screens". Does anyone know how to do this?
2
votes
2answers
17 views

can't get query to order posts by acf datepicker

I've read alot, I've tried a bunch of different things, I still can't get my query to order posts by acf's datepicker field. This is what my code looks like: $args = array( 'post_type' => '...
1
vote
2answers
36 views

Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes

I have 2 custom post types, project and person. Both have several custom fields. I'm working on a template for the project custom post type. In the project custom fields I have several fields of type ...
1
vote
1answer
12 views

How to filter get_post with ACF by a checkbox field?

So, I have a custom content type called "team" where I have an ACF field attached called "external" which is a checkbox. I am currently getting all the posts by passing the following arguments array ...
1
vote
0answers
11 views

How to Bind one post object Type with other postobject Type in Advanced Custom field [closed]

In advanced custom field i have two custom field i.e.product and brand . product and brand are custom post types. in product it shows all product post through custom field and brand also it shows all ...
2
votes
1answer
11 views

How to conditionally register nav menus with advanced custom fields?

I have a theme that uses Advanced Custom Fields to allow the user to select different header options. One of the header options (where the logo sits in the middle of the page between two menus) ...
0
votes
0answers
10 views

Gravity forms dynamic checkbox values based on selected dropdown

How could I make checkboxes dynamically populated based on selected item in dropdown. I managed to display the lists of post titles from post type in a dropdown using gavity forms hook '...
0
votes
0answers
31 views

How to build a contact form with ACF in the middle of it

Background: I'm doing a photography website and this is an order form. The design is: Input field to choose how long of a photo session. ACF fields to show products and prices. ACF field ...
1
vote
1answer
29 views

Custom query based on meta key - Reduce three states to two in results?

$args = array( 'post_type' => 'bars', 'posts_per_page' => -1 'orderby' => array( 'meta_value' => 'DESC', 'title' => 'ASC' ), 'meta_query'...
1
vote
0answers
33 views

ACF Wysiwyg Editor Image srcset for responsive images [closed]

I cannot find a way to generate srcset for images added inside Wysiwyg Editor field of Advanced Custom Field (ACF) plugin. Obviously, i know how to generate WordPress image srcset using: ...
1
vote
1answer
32 views

Group ACF repeater fields from differrent posts

I have done a bunch of searching and can't seem to find a resolution particular to what I'm looking to do. I've also tried to post this on the ACF support forums, but it kept deleting my post after ...
1
vote
0answers
20 views

How to Union two different conditions in one WP_Query

I need to query in one WP_Query: All posts that are children of category id = 6 and also the posts in category 7 but only those that have been checked a custom field of ACF (true / false). In SQL ...
1
vote
1answer
37 views

Loop through custom fields with similar label / common chars in label

I created several custom fields for my custom post type "books" There is a checkbox for languages. Whenever a language gets checked, several custom fields for that language get added (i.e. title, ...
1
vote
1answer
11 views

Remove YoastSEO meta description from output/source [closed]

I want to have a drop down for my client to choose a particular set of meta descriptions, I can get that meta description to appear but I can't seem to find a way to get the existing YoastSEO meta ...
1
vote
1answer
21 views

ACF get field label in custom code

I have some custom code in order to display my custom fields the way I want. Unfortunately, with this code I can't seem to access the $field['label']. I tried various ways but don't really know how ...
0
votes
0answers
42 views

wordpress REST-API upload image to ACF

I created my own API using Wordpress Rest-API. I successfully saved all data in wordpress backend but I don't know how to get and save the data if file/image. register_rest_route( 'mlcs/v1', '/...
0
votes
0answers
37 views

Shortcode to display just one row from the repeater field

I am using ACF repeater field for making a custom menu so I can use different menus on each product description page. I have added an options page to allow the user to add details from the dashboard. ...
0
votes
0answers
22 views

Sort admin column based on an acf within a post object

I have a question about sorting admin columns based on an acf, and the 'post_title' within within a post object. I am following this set up here - https://www.ractoon.com/2016/11/wordpress-custom-...
1
vote
1answer
33 views

How I can check if get_theme_mod is in header or a template part

I am using understrap theme and ACF in a website and I want to alter the default understrap's container type behaviour. I created a custom field to override the theme container type in a specific page ...
0
votes
0answers
9 views

How to paged a custom field

Problem I have a custom field called "week" with values like 1, 2, 3 created with ACF would like to know how to be able to create a paged. I would like to put in a template a system that appears the ...
0
votes
1answer
25 views

Why is wp api returning old acf values?

I have a list of custom post types (Events) with ACF fields for start and end dates that I'm getting using WP-API. I'm using the fetch api to make the calls. I have the acf-to-rest-api plugin ...
0
votes
2answers
28 views

How can I add multiple 'tax_query' arrays via a loop?

I'm trying to build functionality (using the Advanced Custom Fields plugin) to list information in a page template for all custom post types ('Product') that have specified taxonomies. This is my ...
1
vote
0answers
15 views

Query Posts depends on custom field inside repeater field using acf

i am working on a hotel website and trying to make price search i have custom post type name hotels inside post type i have a repeater field inside repeater i have some rooms with prices i am ...
1
vote
0answers
13 views

Update grandchild repeater field with value per row

I'm trying to take the following data from a table: And input it to a nested ACF repeater field. I've got very close in that it's creating the correct amount of tables (3 from the example), the ...
0
votes
1answer
18 views

what is the method to echo class attribute inside the i tag? [closed]

I am having line like below and it works fine. echo '<li><a href="' . get_term_link( $term->slug, 'amenities' ) . '"> <i class="fab fa-safari" style="font-size:25px;color:#981111"&...
0
votes
1answer
139 views

How to count ACF Flexible Content Rows?

I have a flexible content field set up with just one type of layout. I need to get the total count of layouts but my count is only returning 1 every time. Here is the ACF field setup: And here is my ...
0
votes
0answers
25 views

Error in Validate Field with ACF plugin in Wordpress

I have the following problem when I am validating a field with the Advanced Custom Fields plugin in wordpress. What happens is that the field is validated correctly but the error appears on a new page ...
0
votes
1answer
95 views

Scheduling a post using publish date from a custom field. Resulting post is set as published in the future instead of scheduled

I've been trying to set a scheduled publish date using an ACF field. I'm trying to make a custom backend editor for computer-illiterate clients to create and edit posts. I believe that the default ...
0
votes
0answers
70 views

wp_get_attachment_image_url not returning correct url for custom size set

I'm trying to retrieve all image urls uploaded to a single post and store these in an array so I can access them within my document. I'm using the advanced custom fields plugin to upload images too ...
0
votes
1answer
25 views

ACF page while loop breaks footer while loop

So basically i have a main page and a footer page. Both are seperate .php files. Im using ACF for this site. Following the documentation, ive created a while loop for my 'flexible content' in the ...
0
votes
1answer
21 views

get_posts of Custom Post Type AND Custom Taxonomy

I'm trying to pull custom post types that have a specific custom taxonomy This is what i've tried: $args = array( 'posts_per_page' => -1, 'post_type' => '...
0
votes
0answers
15 views

Adding a custom field which shows shortened URL with link clicks

This is a field on a custom post type. When a user fills out the first field Wordpress should generate a shortened url, and below that I want to know information about the shortened url loaded via ...
0
votes
1answer
20 views

Advanced Custom Fields, DatePicker - Check if Set

I am trying an IF statement to check if the user has actually selected a value in the ACF DatePicker but this doesn't validate correctly. Any ideas? $fxdate = get_field('fl_date'); if (isset($fxdate))...
0
votes
2answers
28 views

Is there a better way of retrieving the name of an acf pagelink type from current post?

I'm using Advanced Custom Fields. I have a registered bookitall_roomstype custom post type. I have a registered bookitall_bookings as another custom post type. In the bookitall_bookings there is a ...
1
vote
1answer
35 views

ACF simple text field value not showing

I registered custom post type in functions.php like so: function ourproducts_post_type() { /*Labels*/ $labels = array( 'name' => _x("Our Products", "post type general name"), '...
0
votes
1answer
15 views

How to use single.php for creating, reading and editing Custom Posts with ACF

I have a WordPress custom post type product and I am now developing front end forms for creating, reading and editing these posts (I am using ACF). I am trying to use only single-product.php for this ...
0
votes
1answer
39 views

Hidden field in acf

I want to have a “like” field for every post, this field supposes to hold the number of likes for every post. But the problem is i don’t want it to be visible when editing post and no one except my ...
0
votes
0answers
28 views

Creating a page from acf fields

I have a number of acf fields(advanced custom field), that have different fields, text, etc. I wanna know if it is possible to create a page for each field repeater, which will use a certain template,...