Home › Forums › General Issues › use a ACF to replace post title in this code › Reply To: use a ACF to replace post title in this code
@billy_mac – you should be able to replace the line:
the_title(
'<h3 class="wpgb-map-marker-title"><a href="' . esc_url( get_the_permalink() ) . '">',
'</a></h3>'
);
with:
echo '<h3 class="wpgb-map-marker-title"><a href="' . esc_url( get_the_permalink() ) . '">'. get_field( 'FIELDNAMEHERE' ) .'</a></h3>';
just make sure FIELDNAMEHERE is changed to the field name you setup. Depending on your page template setup, this should work out of the box.
Otherwise, you may need to configure the get_field() a bit differently (see reference link)
— the_title() documentation shows a bit of how it formats in correlation with the Post/Page Title, so basically, removing that function and echo-ing it in without the assistance. See Reference
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.