Questions tagged [advanced-custom-fields]
OFF-TOPIC. Support questions should be asked on the plugin's support page.
1,510
questions
19
votes
2
answers
78k
views
Where are custom field values stored in the database
I am using the advanced custom fields plugin for posts. I would like to know where custom fields are stored. I checked the wp_posts table. However, I could not find the posts with custom fields. I ...
18
votes
5
answers
16k
views
Filtering multiple custom fields with WP REST API 2
I want to filter posts based on multiple acf custom fields with AND relation. Something like this:
$args = array(
'post_type' => 'product',
'meta_query' => array(
'...
13
votes
5
answers
35k
views
Filter by custom field in custom post type on admin page
I've used Advanced Custom Fields to create custom fields for Competition name, answers etc. I've made a custom post type for competitions as shown on the image and I used Wordpress functions.php to ...
12
votes
2
answers
63k
views
Getting custom taxonomy from custom post type
I have a custom post type called email_block and have a custom taxonomy called block_type. I need to loop through all the email blocks find out what custom taxonomy (block_type) they have. I know how ...
11
votes
2
answers
3k
views
Media library - Limit images to custom post type
Is there some wordpress magic/plugin that will make the media library only show images that were uploaded to a specific custom post type?
I have a custom post type called "artists", I want, when admin ...
10
votes
3
answers
143k
views
WooCommerce shop page to use my custom template [closed]
Before asking the question I want to tell you that I have already asked the question in https://stackoverflow.com/questions/15025213/wordpress-woocommerce-template-file-overiding
I am using the ...
9
votes
2
answers
12k
views
Unable to check if plugin is active
I am working on a custom theme using ACF. I would like to check if the plugin is active or not. I am using this code:
<?php include_once( ABSPATH . 'wp-content/plugins/advanced-custom-fields-pro/...
9
votes
2
answers
43k
views
Display all values of custom a field created with ACF on a page
I'm using Advanced Custom Fields / ACF to create custom fields. One of them is a list of checkboxes that display some options (option1, option2, option3...).
Now I want to display all options of ...
9
votes
2
answers
38k
views
Using OR conditions in meta_query for query_posts argument
I have searched high and low for this but I cant seem to locate anything.
I am trying to filter some results and when I make an args array like this and pass it to query_posts I noticed that the ...
9
votes
3
answers
44k
views
How to import CSV into Custom Post Type custom fields?
I have created a Custom Post Type and then used a plugin to create the custom fields for that post type.
It will display a type of membership:
Name
Address
Zip
Website
But I am stuck on how to take ...
8
votes
2
answers
17k
views
Display List Of Posts Containing a Relationship Field Value [ACF]
I have a post type called 'Writers' and another post type called 'Documents'.
I use the Relationship field in Advanced Custom Fields to link a list of Writers (post objects) to a Document. This means ...
8
votes
2
answers
7k
views
Filter next_post_link() and previous_post_link() by meta_key?
I have a page with two sections, each uses a different WP_Query() to pull in events, which are a custom post type. Each WP_Query() queries a meta_key for the event date so that Section 1 only displays ...
8
votes
1
answer
7k
views
importing third party json feed as custom post type [closed]
I have a third party json feed http://feeds.artlogic.net/artworks/artlogiconline/json/ that i need to use to import data in wordpress as a custom post type called "artwork".
Are there are handy ...
7
votes
6
answers
40k
views
ACF - get fields from group
i have been using this code to get all fields from a specific group:
<?php
$GroupOrPostSlug = 'acf_specialgroup';
//or insert the ID of your fields Group.
$groupID='';
global $wpdb;
if (empty($...
7
votes
6
answers
29k
views
Order get_terms using a Custom Field
I have a custom taxonomy of "crb_issues" that has a custom field associated with it that is "issue_date" which outputs a date value for each term to looks a lot like "20140601" yearmonthday.
I am ...
7
votes
1
answer
13k
views
Add custom field to the archive page?
Add fields to archive?
I'm using Advanced Custom Fields plugin (but it's not relevant as I can also use native WP fields) and want to add custom field to the custom post archive page.
The problem is ...
7
votes
4
answers
9k
views
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 ...
6
votes
1
answer
19k
views
Is it possible to add custom fields to a WooCommerce attribute term? [closed]
On Wordpress / WooCommerce, is it possible to add custom fields to a WooCommerce attribute term?
With "attributes" I mean the general attributes and not the attributes under products.
Please, check ...
6
votes
3
answers
16k
views
functions.php inject inline css
I am trying to inject a inline style css to my body element via the functions.php file.
It needs to be inline, because I am using a ACF to let the user change the image.
This should be the result:
&...
6
votes
1
answer
24k
views
update_post_meta and update_field ony working when saving the post
I use Advanced Custom Fields (ACF) to store data in a custom field. I had latitude and longitude information stored separately, but I they need to be in one custom field so I made the function below. $...
6
votes
3
answers
12k
views
Advanced Custom Fields - Get custom fields from parent page
I'm using Advanced Custom Fields making it easier for my client to manage his content.
On all of my child- and parent pages i would like to have the same header image and sidebar information.
...
6
votes
1
answer
7k
views
How to get "Additional CSS Class" for ACF Gutenberg block
I have registered a custom block with ACFs acf_register_block. I have set a render_callback to load a php template but would like to access any extra CSS classes which the user may have set in the ...
6
votes
1
answer
23k
views
how to get posts by custom post type then display Custom fields?
I have custom posts types for Recipes, and within that I have set up Advanced Custom Fields (from the plugin.)
Within, that custom post type, I have several categories. Two questions:
1.) How do I ...
6
votes
2
answers
5k
views
Advanced Custom Fields and Yoast SEO keyword analysis [closed]
The problem I'm having is the keyword page analysis tool doesn't read my custom fields so I am trying to figure out how to run a filter on them.
I found a blog post on Yoast website here here which ...
6
votes
3
answers
15k
views
advanced custom fields update_field for field type: Taxonomy
I need to insert a post via wp_insert_post and then add relevant post_meta - however, the WP admin has been customized with the excellent ACF.
I know I can add_post_meta in this way:
add_post_meta( $...
5
votes
3
answers
45k
views
Advanced Custom Fields select field : How to echo the label, not the value? [closed]
I am using the wordpress Advanced Custom Fields plugin.
This question is about the select field, and in the documentation only tells me how to output the value, not the label/name.
I can't see this ...
5
votes
4
answers
19k
views
How to get current post ID in Contact Form 7 wpcf7_before_send_mail hook action
I'm trying to handle the CF7 data before send and update the current post custom field using ACF function but I'm unable to get the current post ID the form is send from. I've also tried getting the ...
5
votes
3
answers
10k
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://...
5
votes
2
answers
7k
views
Matching Serialized Arrays with meta_query
I've asked a related question previously, but I think I've finally worked out the crux of my issue.
I'm using Advanced Custom Fields and have a number of custom fields attached to my post type. I'm ...
5
votes
1
answer
6k
views
ACF Repeater loops and resets - where is the reset_rows() documentation? [closed]
I love ACF, its great for developers and it seems to have so much support. BUT... Why is reset_rows() not in the documentation? I created a function that can delete repeater rows at different times in ...
5
votes
3
answers
18k
views
Get value in custom field with taxonomy [closed]
I have custom field my_cf for Taxonomy/Term. How can I get and output value with custom field for taxonomy/term?
I've tried using:
$variable = get_field('my_cf', 'basic');
echo $variable;
...
5
votes
2
answers
26k
views
ACF: get_field() returning false [closed]
I have created a custom true/false field with the default value of true. I've set different posts to different values. However, get_field() always returns false:
<?php if( have_posts() ): while( ...
5
votes
1
answer
8k
views
ACF Relationship Field Search Filtering [closed]
I am trying to assign relate posts using the ACF relationship field. It has typeahead search to search by post titles.
I would like to add meta_data search to the ACF relationship search.
This ...
5
votes
1
answer
6k
views
How to List Events by Year and Month Using Advanced Custom Fields?
I have a custom post type "Kalender_item" with a custom Date Field (YYMMDD). I want to list all the posts on a page sorted by Year and Month.
For example:
November 2012 (all events that occure in ...
4
votes
3
answers
15k
views
How to add a custom field to quick edit
How can I add a new column to quick edit and put a custom field in it? I read this question but one of the links lead to an error 404. I need a new column for my custom meta key, "summary" and post ...
4
votes
2
answers
15k
views
Filtering a WP_Query meta_query by numeric values isn't working
That was a very dense title.
I have a custom post type "event" which has a Date/Time picker field "event_date" thanks to the Advanced Custom Fields plugin. This Date/Time picker saves a UNIX ...
4
votes
4
answers
10k
views
How to position a custom field before the editor
I have installed Advanced Custom Fields 4.0.1 and created a new Field group containing a single field called preamble. I would like to position this new field before the editor in the posts edit ...
4
votes
1
answer
18k
views
Populate a ACF Select Dropdown from Custom Post Type
Is it possible to populate an Advanced Custom Fields (ACF) Select Dropdown - options - with all the posts within a specific Custom Post Type (PCT)?
Thanks in advance, Ian.
4
votes
1
answer
13k
views
ACF datepicker meta_query Compare Dates in m/d/Y g:i a - Not in Ymd Format
I'm looking for a way to use meta_query to filter out posts with a meta-key value of a date-time in m/d/Y g:i a format.
The post-meta is being set by ACF (Advanced Custom Fields).
I want to ...
4
votes
3
answers
13k
views
Preferred way to include Advanced Custom Fields in a plugin?
So I am building a plugin for a site that is already using Advanced Custom Fields (ACF). I wonder what would be the best way to include ACF in my plugin? The site is already using ACF, so is it ...
4
votes
3
answers
53k
views
How to display product price of the product in loop
My general question is: how to display product price in woocommerce of a product in a loop, not the price of the product which page it is? In other words I would like to display few related products ...
4
votes
1
answer
11k
views
Automatically fill custom field value on post publish/update
I've searched around a bit, and I'm having trouble finding an answer to this question. What I'm trying to do is automatically fill a custom field when a post (custom post type) is updated or ...
4
votes
2
answers
4k
views
Initialize JS with an ajax loaded ACF form
I'm using acf_form to edit my WP posts with ajax. I've got it setup and working correctly in that I can edit the post and submit the new data without page refresh. I can then also load the new content ...
4
votes
1
answer
5k
views
get_field not displaying my custom field value
I'm asking regarding the ACF plugin (Advanced Custom Fields)
I'm working on creating a category group that will add custom fields to the category pages. These are the fields:
They seem to work in ...
4
votes
1
answer
6k
views
Adding custom fields to the header.php
I want to add advanced custom fields/custom fields to my header.php as it contains text and phone numbers that we may change - I have tried referencing them but it didn't work. I have also Googled and ...
4
votes
3
answers
20k
views
Display post_object content using Advanced Custom Fields plugin
I have a hard time figuring out what's wrong with this code.
What I'm trying to do: setup up a custom field in admin using the ACF plugin to lists in a meta-box on all pages a list of testimonials (...
4
votes
1
answer
4k
views
Using Advanced Custom Fields with Wordpress and Lightbox
I am using the ACF Plugin. I want to have a field where I can upload an image, and the result will display the full image in the Lightbox and then then full image will be resized into a thumbnail from ...
4
votes
2
answers
5k
views
Make permalinks based on an ACF-field
This is both a question on 'how to do this', as well as 'should I do this'.
I have the ACF-heavy site, where I would like to make the permalinks based on one of the ACF-fields (let's call it foo). ...
4
votes
2
answers
8k
views
WP REST API: Order posts by meta value (acf)?
I'm requesting posts with the WP REST API and need to sort them according to an ACF field. It's value represents a date (numeric, jQuery date format yymmdd). I know how to do it with a normal WP_Query ...
4
votes
1
answer
4k
views
Remove old custom field after import
I have imported a set of posts to a new Wordpress install recently. This OLD set of posts had a set of custom fields attached to it (via post_meta using the ACF plugin). The new installation has ...