Site logo

Archived topic

Unable to display custom fields in the front end using CPT + ACF + GPP + GPB Pro

1 reply · Started by Mohammed on November 20, 2021

Viewing posts 1–2 of 2

I'm trying to make a glossary using the plugins listed in the topic title above.

Each custom post is a glossary word and consists of 8 custom fields, for example,

--- word definition (text field)
--- example sentences (text box)
--- word pronunciation (media field)
--- similar words (taxonomies)
etc.

The steps I've taken to implement a custom post type in GeneratePress are:

1. I registered my custom post type using CPT
2. Added custom fields using ACF
3. Acquire the templates single.php and the content-single.php, then renamed them to match the slug of my CPT tag like single-project.php and content-project.php.
4. I updated the single-project.php file. In the single-project.php file, I replaced generate_do_template_part( 'single' ); with the following: get_template_part( 'content', 'project' );

But I'm unable to display my ACF custom fields in the front end of my site.

Please can you explain to me step-by-step how I can resolve this issue? Thanks!!!

Hi there,

so this:

4. I updated the single-project.php file. In the single-project.php file, I replaced generate_do_template_part( ‘single’ ); with the following: get_template_part( ‘content’, ‘project’ );

Needs to be changed to generate_do_template_part( 'project' ); for it to work with the Block Element

This archived topic is closed to new replies.