Home › Forums › General Issues › URL field into button › Reply To: URL field into button
Thanks for your help !
I’ve tried your proposition and the text into the button is correctly displayed but the url return
https://domain-name.com/vibes/Array for every button I’ve created.
I’m using these buttons into a custom query :
<?php $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) : ?> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); $url = parse_url( get_field( 'vibe_url', get_the_ID()) ); $btn_url = $url['host'] . $url['path']; ?> <a class="wp-block-button__link" href="<?php echo $url; ?>"><?php echo $btn_url; ?></a> <?php endwhile; ?> <?php endif;?>
so I’ve guessed it could be a scoping issue but adding
get_the_ID() in second parameter doesn’t help 🙁
What do you think?
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.