Home Forums Front-end Issues Display all fields with classes like acf_form() … but static, without the form


Display all fields with classes like acf_form() … but static, without the form

  • Hi! I’ve built a frontend form using acf_form() and everything is swell. I’ve added classes in the various fields and everything looks great.

    After a user inputs a set of content into the form, I’d like to be able to display the content in a similar layout … just without the form. All the content would be static, inputs would be just <p> tags and the classes added to the ACF fields would be maintained so the form and the static displays look similar.

    I can’t see a function to display all fields on the frontend like acf_form() … but without the form. I’m sure this has been done before.

    Any tips would be really appreciated. Thanks!

  • There isn’t anything built into ACF to allow this. It might be possible, but the process for doing this would be more difficult than simply outputting the fields (ie using get_field() and the_field() etc) along with your own HTML and CSS to format the values the way you want them shown.

  • Thanks so much, John. That’s what I figured. It’s a bummer that the classes added to the fields in the backend can only be output on the frontend via acf_form(); but as you point out, it’s not super hard to just manually write the markup.

    Have a good day!

  • The process for doing this would involve showing the form twice, once as “content” and then again as a form. You would need filters (acf/prepare_field) that would only run when you wanted “content” that would convert each field to a message field. All-in-all a lot of work, probably more work than is called for.

  • Thanks! Yeah, I’m already running filters for cf/prepare_field to get Bootstrap classes on there. Thanks again for your help!


Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.