Home › Forums › General Issues › ACF and one page layout › Reply To: ACF and one page layout
Hi @juhoaj
Sounds like all you need to do is create multiple pages in the backend of WP. Each page represents a ‘section’.
Then create a page called ‘Home’ and create a custom page template called ‘home’ for this page to use. Now edit this page template:
1. Use the WP_Query object to find all pages, then, loop through them.
2. For each page (post) you loop through, use the $post->ID to find the ACF data.
Read up on the get_field function to see how you can load data from a specific ID.
Thanks
E
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.