Home › Forums › ACF PRO › ACF fields not working for current page. › Reply To: ACF fields not working for current page.
If you’re trying to get a field for the current page you shouldn’t need to set the ID parameter.
You can just say:
get_field('title');
But if you wanted to pass the ID for some reason you could do:
get_field('title', get_the_ID());
If you’re on another page you will need to pass the ID for the page/post you’re trying to get the data from.
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.