Home › Forums › General Issues › How to display a value from a parent page? › Reply To: How to display a value from a parent page?
maybe that works / help you
<?php
$post_ID = get_the_ID();
$parentpost_id = wp_get_post_parent_id( $post_ID );
$attachment_id = get_field( "broschuren-download", $parentpost_id ); //use parents-post field: "broschuren-download"
$url = wp_get_attachment_url( $attachment_id );
$title = get_the_title( $attachment_id );
?><div class="pdf-download"><a href="<?php echo $url; ?>" >Broschüre herunterladen</a></div>
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.