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” 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.