link acf

Solutions on MaxInterview for link acf by the best coders in the world

showing results for - "link acf"
Leonardo
13 Oct 2018
1<?php 
2$link = get_field('link');
3if( $link ): 
4    $link_url = $link['url'];
5    $link_title = $link['title'];
6    $link_target = $link['target'] ? $link['target'] : '_self';
7    ?>
8    <a class="button" href="<?php echo esc_url( $link_url ); ?>" target="<?php echo esc_attr( $link_target ); ?>"><?php echo esc_html( $link_title ); ?></a>
9<?php endif; ?>