Home › Forums › Front-end Issues › wp localize script and jquery › Reply To: wp localize script and jquery
Perhaps this is not the case. The first message shows that you created a field for a specific post. If you are trying to access this field from another template, then you need to use additionally the id of this post.
in post
<h4>Somme text: <?php the_field('custom_filed'); ?></h4>
outside this post
<h4>Somme text: <?php the_field('custom_filed', $post_id); ?></h4>
e.g.
<h4>Somme text: <?php the_field('custom_filed', 10); ?></h4>
where 10 is ID of post
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.