Home › Forums › Front-end Issues › Adding fields to template for dummies › Reply To: Adding fields to template for dummies
Divi is a complex theme that has its own rules and most WP documentation will not really tell you all the details that you’ll need to know on the “Where” question. The only thing that the ACF documentation will help you with is the “What”. The best source information for “Where” is going to be the Divi documentation and Divi support.
In a normal theme:
If you are adding custom fields to “Posts” the you would put code into single.php or a template part that is loaded by single.php. Where you actually need to put it, like I said, is dependent on the theme. The code needs to be inside the “The Loop” https://codex.wordpress.org/The_Loop and you’ll need to figure out where that is.
If you want the fields to appear on an archive page for “Posts” then you need to start looking at the right archive template.
If you are adding fields to “Pages” then you would put the code into the template or associated file for that page. Again, it needs to go in “The Loop”
Like I said, every theme is different, every theme author builds themes a little differently, and Divi is going to be more complicated. The ACF documentation cannot take all this into account and is the reason that the exact “Where” to put things isn’t found anywhere, that’s something that each developer needs to work out.
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’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U
— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.