I’m not familiar with how ACF ( or any plugin ) applies itself. I’m asking because I’m having issues with ACF ( meta-blocks? ) that aren’t working since latest updates.
Perhaps separate from that though – I’ve been having issues with getting changes to save properly. When I look at the php for the template page I want to edit, I see portions of the ACF code are in there – “hard coded”.
I’m not sure if the previous developer added this code, or if the plugin itself adds the code on that page.
Any insight appreciated.
PS: I fixed the current issues I’m having by just hard coding the fields into the template – and when I opened the template to edit, I was surprised to see one of the fields I wanted to add commented out.
This is how I understand the process:
1) I create a field using the plugin, and assign it to all posts (?) of a certain type ( template, page, etc )
2) On that specified page, I now see the field, and can add content.
3) I hit publish and now people can see the page
Are you saying that for this to be visible to public, I have to edit the template code?
Yes, that is what I’m saying.
There may be other 3rd party plugins that alter this.
There are ways to generically add some fields to the front end of the site that the developer may have used https://www.advancedcustomfields.com/resources/get_fields/.
But as a general rule, ACF fields are only shown if the template is modified to show them or some other tool for altering templates is used.
Hi John – I appreciate your patience – my language is not precise and I want to make sure I understand.
In step-2 above, in wordpress wpadmin, I open a page called Our Professionals. This uses a template called Professionals. In step 1, using ACF, I added a new field to all pages created with the template Professionals.
On the Our Professionals page can now see this new field Job Title and I type “Partners” into the field. Press Publish.
When I press Publish, the wordpess saving mechanism kicks in, and somehow ACF piggybacks on this, so the field Job Title and it’s content Partners is included and saved.
I do NOT need to manually edit any PHP templates ( as in writing out PHP code to call the field ) .
Not Correct. At least not normally.
When you now view this page do you see your new value shown anywhere? If you do than there is already code to display the new field how it is being shown. If not then you will have to modify the template if you want to see this new information.
The topic ‘Does ACF work by directly editing template files?’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!