Home › Forums › General Issues › Where can I place the code? › Reply To: Where can I place the code?
You have to add it to content.php. The reason you add it here to add it to all your blog posts, is that it follows a hierarchy of templates to call the content.php into every blog post. It goes Main Index Template(index.php) > content.php. Meaning content.php is part of the Main Index Template.
So if you want to add your field right under the title, go to content.php, and add your php snippet under a div tag classed “entry-content”. Just add it under that opening tag. 🙂
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.