Home › Forums › General Issues › Selection option used in header › Reply To: Selection option used in header
Hi @justawebbie,
If this code is in your header, I’m guessing you’re trying to pull this field in from an options page?
If that’s the case, you just need to add in another parameter to get_field()
.
So it would become get_field('options_posts','option')
.
If you’re just trying to pull in the field from the page you’re on, I’m assuming your header is being called before the WP loop starts. In that case, you’ll need to pass the page/post ID to get_field()
instead. Let me know if you need more clarification.
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.