Home › Forums › General Issues › Text Fields, Set Location on Post Types
Trying to figure out if ACF will do what I need.
I want two text fields added to ALL my posts. I installed the Plugin, added the 2 fields. But can’t figure out how to set the location. I want those two fields to show up on every Add New Post. So how do I configure it for every post, not just specific post types?
And then, once it’s set, what happens to the text that gets entered into my text fields?
With core ACF you need to set the location of every post type. I have attached an image that shows this for posts and pages. If you have other post types then you would keep adding additional OR location rules.
Alternately you could create your own custom location rule https://www.advancedcustomfields.com/resources/custom-location-rules/. I have several examples of these I have created here https://github.com/Hube2/acf-filters-and-functions. I don’t have one for “All” post types, I’ve never seen a condition where I want something added to all post types. I do have one for “Public” post types https://github.com/Hube2/acf-filters-and-functions/blob/master/public-post-type-location-rule.php
The values for the fields are saved as WP postmeta values, not different than you would do using WP function like https://codex.wordpress.org/Function_Reference/add_post_meta
Well, my site is pretty simple. I’m not using post types. All posts are of the same type.
Looked over the examples, it all seems to be much more complicated than what I’m looking for.
Wouldn’t mind buying the PRO version if I were certain of getting the help I need with this.
just want two text fields for every post.
So, just adding two fields to every post is pretty simple. You just create a field group with the two fields for post type == post.
But I have a feeling that what you’re looking for is adding these fields to the front end where the posts are shown. If this is what you want, this does not get done automatically. You’ve got to edit the template code for the front end to do the adding.
The topic ‘Text Fields, Set Location on Post Types’ 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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.