I am having problems trying to get custom fields to display in the frontend to work. I installed Custom Post types UI with the following settings:
slug: casestudies, Supports: Titles, Editor, Custom Fields, Featured Image
Next I installed ACF with the following settings:
Field Group: Case Studies, Show this field group if: Post Type equals casestudies, Field1: odmfullname, Field2: odmemail.
I created 2 sample case studies posts: leeashworth.wpengine.com/casestudies/debbie and leeashworth.wpengine.com/casestudies/cs-john. My problem is that neither of those pages will display the custom fields I created. Further I have no idea how to force those posts to display a specific template.
Custom fields created with ACF to done automatically appear on the front end for posts they are attached to. You need to add code to the template files in order to show the fields.
In your case you should create a new template file names single-casestudies.php. This template will show each of the posts in your custom post type. You can start by copying the file single.php and then edit it.
The next step is to add php code to get and display your custom values. Form more information you can start with the_field() and look at other documents depending on what you need to do.
I think this is a little stupid. Because you buy a plugin for this exclusive function and the fields are not displayed on the front end. Thousands of people searching for the same thing on the internet. The plugin is good, but this is something that makes no sense.
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