People who code: we want your input. Take the Survey

Questions tagged [advanced-custom-fields]

OFF-TOPIC. Support questions should be asked on the plugin's support page.

Filter by
Sorted by
Tagged with
0
votes
2answers
32 views

how to load random related posts with specific custom fields?

I want to load 3 posts that have the same custom field value as the current post. for example: The current post has 3 custom fields: color: black background: red lastname: doe Now I want to load ...
0
votes
0answers
12 views

search form for custom fields

I want to create a custom search for pin code search with custom fields value. When exact match with pin code will show the post data Can you please help me? Any help in this matter would be ...
1
vote
0answers
19 views

How to add Advenced Custom Fields In Single Post

I Need Help, I add ACF code in single post download button showing but in link of download button same of link post, I add other website and link in button download always same, what's wrong in my ...
0
votes
1answer
27 views

HTML Special Characters in URL string [closed]

I am using this code to convert the & to its html entity but it doesn't work. The output is passed to a field in gravity forms. <a href="/enquiry/?event=<?php $urlst=get_field('fl_name')...
0
votes
0answers
20 views

How can I show ACF repeater first row and column post object only as a dropdown list upon select

I have created a repeater field using ACF and inside two post-object field where post type only pages and (parent page) First one multiple select None (sub page) Second one multiple select yes I ...
1
vote
0answers
20 views

ACF: Update field values and save to database [closed]

I'm looking to update ACF custom field values on the database. The furthest I've got is to load the values in but I need to then update the posts manually for them to save to the database. add_filter('...
0
votes
0answers
72 views

Excluding posts from search results page with meta query not working

On my search results page I have two loops. First loop displays post by meta value and second loop is "regular" loop that display posts by search query: <section> <div class=&...
0
votes
0answers
48 views

pre_get_posts hook not targeting search results page query

I'm trying to target search result page query with this code: function my_custom_search_query( $query ) { if ( ! is_admin() && $query->is_search && $query->is_main_query() ) ...
0
votes
0answers
16 views

Custom hook after user successfully verifies email

Can anyone help me creating a function that I could use for the following scenario: Basically I am trying to create a register form that has a hidden custom field with value of a post ID and store it ...
0
votes
0answers
15 views

How to dynamically set a background-image size?

I have a 1600 x 1000 image that's used as a background image, with an ACF repeater field that outputs each section, each with its own unique background image. I'm concerned about mobile. Is there a ...
0
votes
1answer
14 views

Using ACF default value to autoincrement a number field

I am trying to create a field called "numero" as an auto increment field with advanced custom fields. This function with WP_Query returns the last inserted "numero". function ...
0
votes
1answer
14 views

Access category within rss2_head hook?

Can I access the current category of a category feed with the rss2_head hook to add for example itunes tags? Lets say I have wordpress.com/catx/feed I want to get acf field elements associated with ...
1
vote
1answer
33 views

Add original validation rule to Advance Custom Fields

I like to set validation when both fields named species1 and species2 are no values. I set below code on function.php. Now, validation always stops update however I set value on these field. //ACF ...
0
votes
1answer
31 views

ACF put a comma after the last repeater field value [closed]

I've the following code <?php if(have_rows('ore')):?> <?php while( have_rows('ore')): the_row(); $start = get_sub_field('start'); $end = ...
1
vote
0answers
30 views

Custom Taxonomy terms aren't getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?

I am using Woocommerce, Elementor, ACF Custom Fields and CPT for Custom Post types. I have a custom taxonomy called 'biographies' which has some associated custom fields (first name, last name, birth ...
0
votes
0answers
13 views

wanted to sort the wp_query array by two ACF field (Year and month)

Want to sort the wp_query by two acf field i have created month and year, my problem statement is there are multiple post(newsletter) where they have two ACF fields month and year. I able to sort them ...
0
votes
1answer
14 views

ACF - get custom taxonomy term image field

I have loop that displays all terms from custom taxonomy. I also have image field, attached to custom taxonomy. Now, I want to display image in my page template: <?php /* Template Name: Služby */ ...
0
votes
1answer
42 views

Show ACF field with link to ultimate member profile/Wordpress user profile below the post (single post layout)

I'm using Advanced Custom Fields and I'm trying to show a custom field below the single post. I managed to get the code to render below the post, but when I set the field movie_actors and save, the ...
1
vote
2answers
17 views

Using a post-signup hook to get user details

Update: I got this working with a different hook user_register. It looks like wpmu_activate_user was never triggering. I would still like to have this happen after the user verifies and sets a ...
0
votes
1answer
25 views

Populating ACF Image Fields from JSON file

I am wondering if any ACF pros can help me here. I am considering auto populating custom posts that have ACF fields from an external JSON file created by an APP. this would update every 30minutes by ...
1
vote
2answers
27 views

WP_Query to select custom post type with Advanced Custom Fields (ACF) date

1st post on this forum so sorry if not enough detail passed. I am trying to use WP_Query to gather CPT that have an Advanced Custom Field (WP Plugin) of "End Date", the field is a date ...
0
votes
0answers
26 views

Create/populate Custom Posts ACF fields from external JSON file

So basically i have an App where users upload recipes and the data is stored in a JSON file on a third party server. What i want to do is fetch the data from the JSON file (url) every hour and use it ...
0
votes
1answer
17 views

Populate select list with meta values from all posts of a Custom Post Type

I've got a CPT of Inventory and I'm trying to show a dropdown of all Mfrs. I've got the form and pre_get_posts function so that when a user selects a Mfr, the page refreshes and shows only the ...
0
votes
0answers
12 views

Filter taxonomy terms by custom ACF field in admin area

How do I add a custom filter to a taxonomy in the admin view (/edit-tags.php), and how do I use a ACF field as what to filter by? I know that you can add a filter to the post list view with the hook/...
0
votes
1answer
25 views

Custome fields not displayed

I am unable to see the custom fields I have added in the website. I have done the following: I have installed Custom Post Type and Advanced Custom Fields plugins. Using them I created a custom post ...
0
votes
1answer
25 views

Expire post to draft by date-picker custom field

Need to set post to draft when it reaches date from ACF date-picker field. This is code I'm using: // expire offer posts on date field. if (!wp_next_scheduled('expire_posts')){ wp_schedule_event(...
0
votes
0answers
8 views

Post content synchronization for two languages

I need to make website work in 2 languages. I am interested if I can set automatic duplication of posts content across the languages once post is published in one language (including ACF radio buttons ...
0
votes
1answer
18 views

Filter works on last selection but no others

I have been working on a frontend filter using ACF Custom Fields. I can filter by the last selection states. but can't select any other option. Below is my code any help would be greatly appreciated. ...
0
votes
0answers
14 views

How to query results for post_title and Custom Post Type/ACF field pivot query

I have a custom query that needs to match a search term to a custom post type of event by post title and by an ACF field host and then filters out events that have passed the current date to a REST ...
0
votes
0answers
15 views

Advanced Custom Fields “Flexible Content” to not echo header if layout is unused

My website allows front-end users to create posts, they can add quotes, highlights and sources for their content. I am using Advanced Custom Fields "Flexible Content" for the user to add as ...
0
votes
1answer
46 views

WP get_posts meta_query using ACF repeater field

I have a Custom Post Type of 'ITEM' that allows the admin to add an 'Item Number' using an ACF text field. In another Custom Post Type of 'GROUP' the admin can use an ACF Repeater to enter multiple '...
0
votes
0answers
25 views

meta_query not behaving well with spaces

I have created a custom search page where i can search in a Custom Post Type (Products) based on a number of custom fields that each product post has. This is the search input: <form role="...
0
votes
0answers
14 views

Get ACF Taxonomy select values to update based on previous field selection

I have three Taxonomy fields on my page ('Sector', 'Subsector' and 'Key Role'). The Taxonomy itself is called 'Job Category', and 'Subsector' and 'Key Role' are both children of 'Sector'. So for ...
0
votes
0answers
18 views

Show content between ACF fields for start and end time

I've been trying to work out how to implement an acf timepicker field into my php. The idea is, if the current time falls between my selected start and end times then a certain piece of content will ...
0
votes
0answers
15 views

Setting Advanced Custom Field ACF Predefined Value

I want to set predefined field and value for ACF with repeater from child theme. So I want to create field like in the picture below, and all the data I'll import from csv, only the active they can ...
0
votes
0answers
20 views

Wordpress URL rewrites using Advanced Custom Field

I've been working on this for a couple of days now. There have been many similar solutions here on this site, but none of them have worked out for me, or they nearly do, but then something else breaks....
0
votes
0answers
12 views

How do I set/save a custom taxonomy term selected in a custom field (select element) to the post?

I'm a bit out of my element and feeling very stuck on something that seems like it's really obvious. Basically, my question boils down to me not being able to "save" custom taxonomy terms ...
0
votes
1answer
19 views

How to add a custom field for image in “Text and Full Image(text right)” layout?

I need add another image in the standard "Text and Full Image(text right) layout" in WordPress. This layout by default has a field for an image. I located the php file that renders this ...
0
votes
0answers
23 views

Dynamically Set Default select value from CPT in ACF form via ACF Post Object

I have an ACF form on my site which let's user create their own size which is stored as CPT, if user is logged in I want to show him list of saved sizes, and I want form to load select field default ...
0
votes
1answer
36 views

Custom sort comments with select form

I use ACF Pro to create a customized comments section with additional fields to my custom post type called Products (it's a simple page with a custom comment section, NOT using WooCommerce). Now ...
0
votes
1answer
29 views

Custom Post Type and Structure Question

I'm working on a site with a structure I haven't seen in the past. Specifically, the site has Inventory Items (custom post type 'item') that show on Item Archive and Item Single pages. For some of ...
1
vote
1answer
20 views

Update posts after populating ACF field value [closed]

I'm running a function to populate some custom fields with some values specified: add_filter('acf/load_field/name=event_end_time', function($endField) { $endDate = get_field('event_end_date'); ...
0
votes
0answers
22 views

ACF group field disappeared after deployment using deployer script

When I deployed a code from local to staging server after ACF Fields are disappeared in the pages, I am using a deployer script to deploy a code from the local environment to a staging environment ...
0
votes
0answers
16 views

Adding inline style to CPT admin backend

Let's say I have a custom post type that looks like this in my backend: How can I add some HTML inline style to the status column based on the content itself? For example, when the status content is ...
0
votes
1answer
252 views

JSON - Create rest api endpoint for Advanced Custom Fields

I using plugin advanced custom fields to show recommended posts in my sidebar (posts that authors select as recommended using radio buttons (yes or no)). And it is all working well. Now, i will need ...
0
votes
1answer
121 views

Display a Custom Post Type with Advanced Custom Fields on Homepage

I'm pretty new to WordPress coding. I currently use Themler for my WordPress theme which allows you to put a CMS Code container right into the page and display any WordPress code. I am using the &...
0
votes
1answer
15 views

Trying to add ACF to authors meta and adding a class at the same time

I am trying to add a an acf field called "name" while also adding a css-class to it the_field('name') to this code if ($go_magazine_options['post_meta_author'] === 'enable' && ...
1
vote
0answers
15 views

Link theme options page using ACF to styles

Forgive me, I'm very much a beginner. I'm looking into custom theme development and creating a theme options page. Using the options page, I want to set a primary color that will be used across all ...
0
votes
0answers
12 views

Build a custom search date filter based on date ranges in ACF text field

I have cars not available during range of periods. These periods are on one ACF text fields (in json) named date_not_available like this : [ {"from":"22/03/2021","to":&...
0
votes
0answers
15 views

ACF update_field is not getting saved after wp_insert_post

I have the following loop where I insert new custom post types in db and after I try directly to add some ACF field values which they are never getting saved. What is wrong in this case with the code ...

1
2 3 4 5
27