Hi
I have a file custom field created and displaying links to uploaded files without any problems.
But how do I get the plugin to not show any link if there is no file uploaded for a post.
I tried this code but the posts are just blank…
<?php
if( get_field('floorplan') ):
?><a href="<?php the_field('floorplan'); ?>" >Download File</a><?php
endif;
?>
Any ideas why this is not working please? Any help is much aprreciated.
Thanks
Hi @toolshed
Your code looks fine and should work.
Hmm… Have you tried to print_r(get_field('floor_plan'));
when there is no uploaded file to the post to view if it contains any data?