I’m observing three problems here.
1- Your anchors do not have a href
attribute.
As you mentioned, the app_url
field is a URL, and should be output in the href
attribute of an anchor. So, this is how your anchor should look like:
<a href="https://wordpress.stackexchange.com/questions/293751/<?php echo esc_url( get_field("app_url' ) ); ?>">My Link</a>
Note that I’ve also escaped the value by using the esc_url()
function, to eliminate invalid characters.
2- The get_field()
function accepts a post ID.
The second parameter of the get_field()
function accepts a post ID. So, let’s pass it to the function in the loop:
<?php
$args = array( 'post_type' => 'slider');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) :
$loop->the_post(); ?>
<a href="https://wordpress.stackexchange.com/questions/293751/<?php echo esc_url( get_field("app_url', get_the_ID() ) ); ?>">
<?php the_title(); ?>
</a><?php
endwhile;
?>
3- You forgot to use the PHP tags
Note that you didn’t have opening and closing PHP tags around your anchors in the loop ( The <?php
and ?>
tags ), and there was a missing a
in your closing </a>
tag.