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

Best practice for custom primary color of pages

My website should have 6 color. A "maincolor" can be selected for each page. The color is set by an acf inside the body class (It's a select field on pages and it return the value.) <body ...
  • 1
-1 votes
1 answer
12 views

How can I use Advanced Custom Field Option page in CSS Wordpress

enter image description here <?php header("Content-type: text/css; charset: UTF-8"); //look carefully to this line $primary_color = " get_field('primary_theme_color', 'option');&...
0 votes
1 answer
12 views

How to get all specific fields from one ACF Group?

I have created few question/ answers using ACF. Field names are question_1, question_2 and so on. My codes are: <?php if (get_field('question_1') == 'yes') && (get_field('question_2') == '...
  • 39
0 votes
0 answers
22 views

ACF field as an identifier in the url . How to implement?

The acf field as an identifier in the url Suppose I have a custom entry type - site.com/mods/ I want to use the hidden field as site.com/mods/XXXX where XXXX is the reference number starting from 0001 ...
0 votes
0 answers
13 views

Filter page ID outside the loop and order

I try to create a shortcode to display a list of events (which is an ACF CPT) on other CPT pages. In ACF the CPT "events" have a relationship field with "CFA" custom post type ...
0 votes
1 answer
16 views

How to detect if an ACF custom-field is really in use?

I want to find out if a custom-field is in use for a post or term. That means the custom-field has a content and is not empty. I guess that's more difficult for selects, radio or checkbox-inputs. So ...
0 votes
0 answers
13 views

Question regarding the file path for media_sideload_image and wp_upload_dir()

Just need some advice on uploading images. I am using ACF / oEmbed to display a video in my blog and in the process extracts the thumbnail from Wistia which works fine. However, I need to put the ...
0 votes
2 answers
34 views

Elementor Custom Query to get Posts by ACF (Post Object Field

I have two custom post type Author and Book. The book cpt have an ACF Object Field (authors_object_field) that is related to authors. On the author single page i want to display all books that have ...
0 votes
0 answers
14 views

Add field to category woocommerce page

I added a field to product category page in woocommerce with ACF. Here's the code from the ACF documentation for showing a field : <?php get_header(); // get the current taxonomy term $term = ...
  • 1
0 votes
1 answer
28 views

Display ACF object field data using Elementor Custom Query

Hello i'm working on a website using elementor pro + ACF. I have create a custom post type (CPT1) with ACF object field that take another CPT2 as values. I would like to display on my CPT1 page all ...
0 votes
0 answers
22 views

Custom WordPress Function - Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)

I've searched far and wide for a solution to the problem. I'm almost there, but can't seem to get it working completely. Background There are 3 post types that are involved in this function: League, ...
  • 3
1 vote
0 answers
16 views

How to link ACF relationship field to the new Query block in Full Site Editing

I am using the new Query block on WordPress Full Site Editing and I am trying to figure out how to connect that to the ACF relationship field. So I have an ACF field on my category that allows the ...
0 votes
0 answers
8 views

Get posts using multiple values from ACF checkbox as meta query wordpress

$args = array( 'posts_per_page' => -1, 'post_type' => 'products', 'meta_query' => array( array( 'key' => 'colors', 'value' =...
0 votes
0 answers
7 views

Custom headings on WYSIWYGs per flexible content module in ACF

We have a master flexible content field. In that field, are all of the components we offer the clients to build with. We need to target ONE of those flexible content field options, and ensure the ...
0 votes
0 answers
10 views

Why do my quick edits for custom taxonomies not show on the post frontend?

So I have created a couple of custom taxonomies and to save time I used the quick edit to apply taxonomy terms to posts. The problem is these changes don't show on the frontend. When I go in to edit ...
0 votes
0 answers
23 views

WP Query orderby ACF boolean values and ACF field value

I have a custom post type with the following ACF fields associated: physician (boolean true/false) mid_level (boolean true/false) provider_last_name (string text) I am looking to display the posts ...
  • 1
0 votes
0 answers
76 views

How to create repeater field manually, without plugin (ACF Pro)?

Looking for a way to register a custom field to appear on specific pages or post types, that would behave as a repeater, whose content I could then get on the front. Paying for ACF Pro for one small ...
0 votes
0 answers
10 views

Update user repeater meta (ACF) with another user meta field value

My goal is to get a signed-in user to select a color (saved in ACF user meta field group) that will be applied to another user meta field inside a repeater. the field must be the same for each row ...
  • 1
0 votes
0 answers
14 views

How to display author details in a custom post type in the wordpress backend?

I was wondering if it's possible to get author details and show them on the edit page of a custom post type in the WordPress backend? I use ACF Pro in this project and added some text fields for the ...
0 votes
0 answers
13 views

Widget Code / Advanced Custom Fields / Elementor

I manage a site that needs to display a widget from a ticket provider, code included below. The widget code is the same on every page the only variable is the event ID. With a different widget I was ...
0 votes
0 answers
38 views

Display ACF category image on archive and single template files

I have written this function to display an Advanced Custom Fields image custom field added to a specific category (News) in WordPress. This image displays on the category archive page and all of the ...
0 votes
0 answers
54 views

Show posts associated with ACF post object and custom post type

I have a custom post type called "team". I created a Post Object with the ACF plugin which Filter by Post Type value of "team" and I target the WordPress Posts for the location. ...
0 votes
0 answers
16 views

Optimising WP_Query with ACF Fields

I am wondering if it's still possible to optimise the WP_Query or also if there's another way of doing it. I have the post type and a custom post type called case-study which gets displayed on the ...
0 votes
0 answers
16 views

Display Post Title From Select Choice Loop in Advanced Custom Fields (ACF) - Wordpress

Dear Wordpress Developer, I have custom post type (CPT) and the name is Programs. Inside the post type admin, I only give the title input and ACF "Select" Field Type. From all ACF tutorial, ...
  • 5
1 vote
1 answer
34 views

Generate the post title from ACF fields

I want to generate post title from first name and last name which are two fields. The posts are generated in WS Form and saved with no title. I tried this code however it does not seem to work. Any ...
  • 11
0 votes
0 answers
30 views

ACF repeater + group shortcode

I've wrote a few line in order to show a restaurant menu in a page using a shortcode add_shortcode ('pescato_repeater', 'pescato_repeater_fn'); function pescato_repeater_fn() { if( have_rows('...
  • 1
0 votes
0 answers
28 views

How to validate custom fields in Quick edit/bulk edit?

I added a few custom fields to a post type using the advanced custom field plugin. The fields I have added are marked required. So technically the post will not be published without adding values to ...
0 votes
0 answers
16 views

Gutenberg blocks (block editor) with get_the_excerpt and get_the_content, using ACF

This feels like a very silly question so I apologize in advance, but when in the loop of page.php, if I use this first function it - it displays the block content exactly as I expect, however in the ...
  • 497
0 votes
2 answers
44 views

ACF get_sub_field ALT TAG in the repeater doesn't show

I have one problem. I can't get the alt tag inside me repeater fields in ACF, I've tried multiple methods and nothing works for me, could you please help me? I can't fix this problem for a week :( ...
0 votes
1 answer
18 views

How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]

I am using ACF Pro to make a relationship between two custom post types. One CPT is a thing and the other is a Container of Things. I need to solve the issue of things within a container of things ...
0 votes
2 answers
29 views

Upload non-featured image to image field

I'm trying to upload some associated media to a custom post type. Using file_put_contents() I'm uploading an image and trying to set an ACF image field to be the path to that file. But reading the ...
  • 130
0 votes
2 answers
23 views

getting image from ACF

I've got a custom field set up using Advanced Custom Fields - the field is named "Company Logo" and is an image field which is returning an image url. I've tried the array and the image ID ...
0 votes
2 answers
24 views

Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches

So I have a complex list of ACF repeaters for ingredients, but have a save hook to store them all as one comma delimited text string in a custom field to help. My current "advanced" search ...
  • 101
0 votes
1 answer
35 views

TinyMCE's "Clear Formatting" button doesn't remove lists and headings

Pressing the "Clear Formatting" toolbar button removes styles like bold and italics just fine, but it leaves lists and headings (h1, h2, etc.) as-is. Is there a way to include all elements ...
  • 277
0 votes
1 answer
56 views

Function wp_enqueue_style was called incorrectly

pretty new to this... can anybody tell me what i am doing wrong? Notice: Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the ...
  • 1
0 votes
1 answer
12 views

Exclude in get_pages() based on meta field

I'm using get_pages() in order to get all the posts from a custom post type hierarchically for creating a custom "next/previous" navigation. I use it like this: $sibling_list = get_pages(...
  • 101
0 votes
1 answer
53 views

How can I hide the ACF shortcode when empty

I am facing a issue. I am using a snippet from github. It renders the URL with some attributes. However, when empty, the short code is still displaying and is not being hidden. Here it is: /***********...
  • 13
0 votes
1 answer
47 views

What snippet do I need to type to show my ACF field show up on my theme?

I've been trying all kinds of things but I can't get it to work cuz my Theme single.php looks different that usual. I made a field in ACF named Region and then enter for example USA which I need to ...
0 votes
1 answer
85 views

Search using ACF repeater

I created a repeater containing Q&A and I would like to develop a search field that looks inside the ACF Q&A repeater for the related result. Could anyone help me where should I start? Thank ...
0 votes
1 answer
63 views

Show/hide posts and categories based on user meta

I've added additional input fields to the user profiles with Advanced Custom Fields (for example "type of customer"). How is it possible to hide posts and categories for users with specific ...
  • 101
0 votes
0 answers
10 views

Add class to all img if they have a certain ACF field

I have an ACF field for image attachments so the user can choose 'rounded border' or 'square border'. How can I apply a class to all images depending on the value of that ACF field? I can do it if the ...
0 votes
0 answers
19 views

Fetch data from two custom post types and create multidimensional array for output to html table

I have two CPT (brochures and brochures_so). In both CPT i use ACF field (key = jaar) brochures Jaar (ACF field) Vakgebied (Custom taxonomy) 2021 Wiskunde 2022 PAV 2022 Frans brochures_so Jaar (...
  • 101
0 votes
1 answer
52 views

Add php code to wp_print_scripts?

Is there a way to add inline php code to the editor using wp_print_scripts? I'm trying to find a way to display text from a php string into a value of input of a block. Here's my code: function ...
0 votes
0 answers
56 views

How To Save Data From Remote APIs To ACF?

I've been attempting to ingest remote data from an api partner into Wordpress. To data I've used wpallimport plugin, but it's quite limited. How would one connect with a remote api and then save the ...
1 vote
1 answer
33 views

list/consult Taxonomy only for the respective author/creator in dashbboard

I'm trying to filter so that only the creators of the respective categories can edit them. I created a cat_author meta field and associated it to the taxonomy. In this way, every taxonomy has an ...
0 votes
1 answer
18 views

comments_where Hook

Is there a similar replacement of the hook posts_where for comments (WP_Comment_Query)? I need to modify the where clause for a comments query like it is shown in this tutorial (“4. Sub custom field ...
0 votes
1 answer
32 views

ACF to select posts not displaying on blog page

I am trying to implement a repeater / post object so I can select posts that I want to displaying on the sidebar. I am using this code: <?php while ( have_rows('top_posts_repeater')) : the_row(); /...
0 votes
0 answers
97 views

Having a repeating custom field in admin custom post type, what I'd go better with, for DB's sake? ACF repeater or query a different post type?

I have: A main custom post type - 'Cards' - each post showing its ACF repeater custom field - 'operations' - with the following sub-fields: 'add/remove', 'amount, 'value', 'date'. Let's say the fully ...
0 votes
1 answer
146 views

How to inherit field value from parent post into in child / sub post

I have created a custom post type, called 'centres'. This CPT is hierarchical, ie, I can create child pages under each custom post. Centre1 Location1 Contact1 Centre 2 Location2 Contact2 I've ...
0 votes
0 answers
33 views

Get ACF taxonomy term and sub-term lists ACF blocks

I want to get list of parents and child terms from ACF field type Taxonomy. This things need to display as ACF blocks. i have tried many things to done this stuffs but but it's not working for me. ...

1
2 3 4 5
30