What to add to the single.php to show ACF field?

Posted in: Newspaper
Post count: 78

I tried it with the single template import and then use the ACF option but it’s not to my liking. Besides that it only shows the entered data and not the field title I would like to know what to add to the single.php because it looks totally different from what I’m used to and I’m having a hard time finding the right code snipped.

So I made a field named Region and on posting I enter for example USA:

It should show like this:

But I don’t understand your single.php, it’s coded totally different so what I need to add to show it properly on the front-end?

Cheers

Post count: 78

I tried to code it like how you guys did it by putting under:
'title' => get_the_title(),
'region' => get_field(),

and the ACF snippet like:
'title' => get_the_title(),
get_field( "region" );

but both don’t work 🙁

Post count: 21065

Hello!

I recommend you to use the ACF plugin with cloud templates and display the custom fields like how it is described in this topic: https://forum.tagdiv.com/topic/how-to-add-code-acf/

Thank you!

Post count: 78

As said, I already did it like that but I don’t want another block, I want to keep the default instead of configuring and redesigning or adjust a new post template. I want the code snippet for the single.php like it normally goes.

Cheers

Post count: 78

Also, the cloud way. I have 2 fields, 1 text and one with the date picker. I can only choose one, it does not show the second field, the date-picker.

Post count: 21065

Hello!

An easier workaround could be to use cloud templates and add the custom field as a shortcode. “Column text” and “text with title” elements have a button called “edit content” and if you click on that button, the WP Editor will open and you can add some text/code/shortcode there. To see the changes, save the changes in Composer and view the page.

Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.