Support

Account

Home Forums Front-end Issues Page Link fails when cloned (Clone Field) Reply To: Page Link fails when cloned (Clone Field)

  • This is definitely happening (and still happening – ACF V5.5.3, WP V4.7).

    dkeeling – a workaround is to check if the value is numeric, and then run it through get_permalink() if it is.

    Your code would look like this:

    <?php 
    $button = get_field('header_button');
    if($button): ?>
      <a href="<?php echo ( is_numeric($button['link']) ? get_permalink($button['link']) : $button['link'] ); ?>"><?php echo $button['label']; ?></a>
    <?php endif; ?>