So I have an issue where I’ve set up a field group which is essentially just a repeater of WYSIWYG editors / images to display when “Page Template is equal to Content Areas Template” and this worked fine and the client managed to get into the posts and add data.
However, we’re now in the position where the data still exists in the DB & the field group still exists in the custom fields admin area, but, if you go into the edit screen of a post, the field group no longer seems to display when the correct template is selected. Meaning the client cannot edit any of the existing data saved within these fields.
Like i said the data still exists within the DB so it’s just an issue getting the field group to display on the posts edit screen which i’m having issues with, i wasn’t really sure where to start with this.
For those who are curious, I created a private ticket and got a solution for this.
The reason is being, in the latest version of ACF, the field group location options only validate field groups which have been registered for that specific post type. By default are only set for pages and thus not evaluated for custom post types.
This meaning, in the actual template file, we need to ensure that the post type is set in the top of the file.
For example in my template-content-areas.php file i needed the following:
Template Name: Content Areas Template
Template Post Type: post, page, custom_post_type
//rest of page markup here
I’m not sure if this will work for pages as previously stated, the field group location settings “By default are only set for pages”
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users