Home › Forums › General Issues › Display the Text Label from a Page Link › Reply To: Display the Text Label from a Page Link
Your code and your explanation are a bit confusing. You’re using the_sub_field()
, but there is no repeater loop. Are these fields part of a repeater? You’ll need to look at this http://www.advancedcustomfields.com/resources/the_sub_field/, there is an example of a repeater loop there.
It you want to show the title of a page that goes along with a page link field, this can be done by getting the field without formatting it. This should return the post ID and then you’ll need to get the permalink for the page and the title yourself. for more information on this see http://www.advancedcustomfields.com/resources/get_field/
$page_link_id = get_field('page_link_field', false, false);
echo get_the_title($page_link_id),'<br />',
get_permalink($page_link_id);
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.