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
0answers
12 views

Batch Extract Date from post title and put into ACF custom field

I have a custom post type called 'events' with around 700 posts, the titles are consistently formatted like this: Event Title - January 1st 2019 I need to isolate the date in another field. I am ...
-1
votes
0answers
23 views

WordPress | ACF | Using a variable to get_field()

I am trying to pass a variable to the function get_field($variable) from Advanced Custom Fields. This is my code: <?php // create base begining with a ' $tweet_box_size = '\'grid_box_size_'; ...
0
votes
0answers
20 views

Job search using custom fields

I am working on a job search page. I have created job category, job location, job description and posted date using Advanced Custom Fields. I want to display the job location and category in a select ...
0
votes
1answer
4 views

How to hide sub fields in a field group and also the entire field group if the answer selected is “no”

I have a field group (repeater field type) set up (titled "Units") with sub fields; sq footage, floor plans and availability (this is a yes/no selection). I have the availability sub field to display ...
0
votes
1answer
12 views

Create 3 Levels of relations with Wordpress

I need to create this type of relation in Wordpress: A Catalog can have many Products A Product can have many Catalogs A Category can have many Products A Product can have only one Category So when ...
0
votes
0answers
14 views

Getting the updated value when try to get the value in ACF

I am using the following code in the validate_save_post hook. foreach ( $diff_quantitites as $id => $diff_quantitiy ) { // acf_delete_cache(); $...
1
vote
1answer
28 views

ACF: How to make get_field() ignore the main wp query?

I have a filter applied to the main WP query via a load action (pre_get_posts) for all the admin pages in my website. It simply limits the edit (listing page) to show records created only by the ...
0
votes
0answers
11 views

Null data are being saved after validation of post in ACF

I am hooking to the acf/validate_save_post to validate the save post. // Validate the save post. $this->loader->add_action( 'acf/validate_save_post', $invoice_post_type, 'validate_save_post', ...
0
votes
0answers
12 views

ACF (Advanced Custom Fields) not updating post or postmeta values

After changing the name of a ACF field, existing fields for some posts are not updating, but some are. Also, new posts are recorded correctly and can be updated. It's just that some of the old ones ...
0
votes
0answers
20 views

Display ACF field(s) from widget in FE

I have a problem with displaying ACF fields that I've connected with a custom created widget. Here what I have so far. I've registered a sidebar function myfunction_init() { register_sidebar( array( ...
0
votes
1answer
19 views

ACF - Advanced Custom Fields (Google map shows but wont initiate marker) [closed]

I have integrated the ACF Pro plug-in into a website, all the fields pull through as expected, except the Google Map. I run an 'if not empty' check on my map field before I paste out my map with its ...
0
votes
0answers
8 views

ACF new repeater fields won't save value [closed]

I asked the support for help like two weeks ago. That didn’t work (yet). So to speed up to process I’m posting this issue on here. I have searched for a solution on the internet and I can’t seem to ...
-1
votes
2answers
26 views

Display ACF field only if value is greater than 0

I have an ACF field of paid_attendance - I only want it to display the field if the value is greater than 0. The below code only works if I swap >0 out for an actual number (and that number matches ...
0
votes
0answers
8 views

Using AJAX select field to search and store external relationship in Advanced Custom Fields

I'm trying to get a select field with the "Stylised UI" option to fetch values dynamically using AJAX. The goal is to store a reference to an external ID as well as being able to search in the ...
0
votes
0answers
22 views

Convert number to date format within an array

I have a custom field of deal_date that I need to work into an array. When using directly on a template I can just set the output format directly in the ACF UI. However I obviously cant use get_field ...
0
votes
2answers
10 views

Attempting to add a checkbox to toggle display of a row in ACF [closed]

I'm setting up a custom theme with pages that use flexible content to add content to the page. I'm wondering if there is a way to add a checkbox that will toggle the display of a repeater row (one of ...
0
votes
2answers
35 views

Add user custom fields and make editable on frontend

We are looking for a way to add Advanced Custom Fields data to a user / subscriber after they have purchased a product (Woocommerce). The subscriber should be able to edit these fields on the frontend ...
0
votes
0answers
18 views

ACF - Undefined Index on array

When trying to get a group of custom fields by ACF it returns an array as expected but when I try to echo the value of one of the items I get a undefined index error. The code: $faqHeader = ...
0
votes
2answers
22 views

ACF not showing

I have a (weird) issue - can't get the ACF field to work on my page. I have a simple text_field and it shows on the Homepage page section: ACF settings: Homepage settings (when I refresh the panel ...
1
vote
1answer
23 views

Insert Commas into ACF number field

I am displaying numbers (non currency) via an advance custom field of paid_attendance - however by default number fields in ACF do not include commas or decimals etc. I would like for commas to be ...
0
votes
0answers
20 views

Custom Plugin used for creating widget feat ACF

I'm building a plugin that it needs to create a widget with some custom fields. I'm not an expert, this is my first plugin, but I'm interested to learn on how to develop more plugins. My problem is ...
0
votes
0answers
14 views

Order REST API by acf date picker

I'm currently working with wordpress API, I need to order my callback from the api by my ACF. Right now my query looks like this: https://odeonodense.dk/wp-json/wp/v2/events I want to order this ...
0
votes
0answers
11 views

How to display only those posts as related post which have same post object?

I have two custom post types Lectures and Chapters. I have made a custom field in lectures post type and set the field type post object. In chapters post type I have added Chapter 1: Biology Fsc ...
0
votes
1answer
20 views

ACF attachment custom field in rest response

I created an extra select option ACF field for media uploader and I would like to retrieve the associated values in Gutenberg MediaUploader onSelect. Is there a workaround for this case?
0
votes
1answer
22 views

adding autosave feature to custom fields

Does anyone know how to add autosave feature for advanced custom fields or add acf to the autosave event. I searched about it but I didn't find any solution. thank you
1
vote
0answers
14 views

ACF Query meta_values don't work with 'offset'

I am currently building a featured posts section and I'm using ACF to set which posts will be featured. As they're appear in another section, I want them to start in this query on the third post. ...
0
votes
0answers
42 views

ACF not updating value correctly

I'm creating a backend page that shows off some stats from projects i have included inside my wordpress site. The basic is pretty straight forward: js that sends out an ajax request (action) that ...
1
vote
2answers
41 views

change value of fields created with advanced custom fields in the front

I created a field to enter whatsapp number in the front of a site in wordpress, since the back is simple, but I need to change it from the front section for the users I have already placed an input ...
0
votes
1answer
18 views

Pre get posts sort by meta key returns no results if meta key does not exist

I am able to sort my posts by a custom field ('tour_length_days'). However if this field does not exist on an existing post then it will return no results. I was hoping there was a way to ...
0
votes
0answers
34 views

Dynamic CSS styles with ACF

I'm playing around with ACF to try to create my own rudimentary page-builder. One thing I'm trying to accomplish is using it with Gutenberg to create somewhat of a WYSIWYG. I'm not sure the best ...
1
vote
2answers
19 views

How to loop only categories without posts (+ show category featured image with acf) [closed]

I want to create on my blog a category loop with the featured image. But i don't know how i do that technical. You should only see a list of categories and click on them to get the category site. It'...
0
votes
0answers
16 views

How to create a category loop on my blog (ACF Plugin)

I want to create a category loop on my blog site, i already created some categories and uploaded featured images for them, but what's the next step? Thank you :)
1
vote
1answer
28 views

Getting value from Advanced Custom Fields [closed]

I'm using the Advance Custom Fields plugin in my WordPress website. I have created a template page and set it for home page. In ACF plugin I created a new Field Group called Travel Form and in it a ...
0
votes
1answer
17 views

One post but two separate permalink structure and template views

I am wondering if there is code or a plugin would help to solve my problem. I run a news website. Rather than make a separate custom post type and separate that from the actual story post that ...
4
votes
3answers
149 views

Generate a excerpt from an ACF-wysiwyg-field

I have an ACF-field, that gives an output like this: <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p><img class="alignnone size-large wp-image-48" src="http://...
0
votes
1answer
10 views

Redirect based on referer using Advanced Custom Fields

Im currently trying to protect some WP pages by assigning a specific template to them. Ive created the ACF fields "Referring URL" and "Redirect URL", as these could alter depending which page the ...
0
votes
0answers
51 views

Advanced Custom Fields oembed only outputs YouTube URL

Having the exact same problem as @Hjalmar on Advanced Custom Fields, but still no fix. Only the URL text displays. Tried the original ACF oembed option: <div class="embed-container"> <?...
1
vote
1answer
10 views

How do I go about looping through a advanced custom field on a particular page inside of another page

I have one page lets call it page-home.php and I also have a page called page-custom-field.php I want to have a section of the first page where it loops through page-custom-field.php page and display ...
0
votes
0answers
15 views

Hidden input's value is overrided by acf

I am using acf_form() for user login process. I am doing login process using Ajax and everything is done inside wordpress’ ajax callback function. so I inserted a hidden field inside the form by acf/...
1
vote
1answer
40 views

WP_Query meta_query >= date

I have been trying for hours, I don't get my query to work: display only posts (from custom post type) with a field (Advanced Custom Fields date picker) value that is more than today. echo date('d-m-...
0
votes
1answer
50 views

How use custom image size + ACF + background image

How to get the URL from an image with custom image size to use as a background-image from AFC? Register size in functions.php: add_theme_support( 'post-thumbnails' ); add_image_size( 'homepage-thumb'...
0
votes
0answers
32 views

How to get_terms() only of terms matching an ACF meta value?

My custom taxonomy "company" has an Advanced Custom Fields field group with fields including a Checkbox, "tags". (This adds to each "company" term fields including "tags", which accepts multiple ...
0
votes
0answers
19 views

Dynamically set front page featured image from first image in latest post's ACF gallery

My front page template is set to display the full content of the latest post using WP_Query and a custom page template. Now I want the home page featured image to dynamically change every time a new ...
0
votes
1answer
41 views

Create Shortcode for php code in functions.php

I have this PHP code that shows a related posts element created using advanced custom fields plugin. I want to create a shortcode inside functions.php with the code and then use the shortcode in a ...
0
votes
1answer
17 views

Reference multiple style sheets, clearing styles for permalink page, custom fields for css

my wordpress theme will be styling posts on the index page based on their post-ID class -this will result in a lot of css code over longer durations of time. To keep the website lightweight as ...
1
vote
1answer
20 views

How to set the seo title tag on a page by page basis?

I am storing the SEO title with advanced-custom-fields. How do i set the seo title tag within my single-mypost.php template. This is the place where i can call get_field('title_tag'); I tried ...
0
votes
1answer
27 views

PHP/CSS: Shortcode won't display correctly, and only displays in the head (before content)

Trying to create a shortcode to be implemented to a popup. I'm trying to display four images in a 2x2 grid at the center of the page. The problem is that this shortcode now floats everything left and ...
1
vote
0answers
28 views

Can an array be used as a meta_query value?

I'm trying to query a custom post type (courses) by grade using WP_Query and Advanced Custom Fields (ACF). Grades (checkboxes) are organized by term (groups). Four grades per term, four terms per ...
0
votes
1answer
18 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 ...
0
votes
1answer
16 views

advanced custom fields if field has value show main div [closed]

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