Support

Account

Home Forums General Issues URL field into button Reply To: URL field into button

  • Hi celestial,

    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?

    Thanks again,
    J