Home › Forums › Add-ons › Repeater Field › Display Title of File in href using Repeater › Reply To: Display Title of File in href using Repeater
I’m assuming for second that you realise that this is a WORDPRESS plugin that was made for WordPress users and developers, who don’t necessarily count themselves as php Gurus. I did pay for this product and as such require some support.
Can you please humour me with a working example please. I tried this below but received to values.
<?php
if(get_sub_field('testsubfield'))
{
$attachment_id = get_sub_field('testsubfield');
$url = wp_get_attachment_url( $attachment_id );
$title = get_the_title( $attachment_id );
echo '<ul>';
while(has_sub_field('testsubfield'))
{
echo '<li><a href="' . $url . '" class="wpaudio">' . $title . '</a></li>';
}
echo '</ul>';
}
?>
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.