Replies: 0
Hi,
I’ve added custom field to attach a pdf file and I’m using profile builder to hide the content to no logged member of some posts.
I’ve added to the template file the code:
$files = rwmb_meta( 'field_id' );
foreach ( $files as $file ) {
?>
<a href="<?php echo $file['url']; ?>"><?php echo $file['name']; ?></a>
<?php
}
to show the attachment in the post, but in this way, even if I block the access of the content I can still see the attachment field in the post.
What I cannot figure it out is how to show the custom file inside the loop “the content” to allow profile builder to hide also the attachment field.
What am I doing wrong?