Support

Account

Home Forums Front-end Issues AFC – show files in comments

Unread

AFC – show files in comments

  • I’m trying to add feature to my website where users will be able upload files in comments. I’m trying to do that using Advanced Custom Fields plugin.

    Some parts of job are done. I have upload option while writing comment and after submiting comment the file is visable via WordPress administration.

    Comment administration (file is visable at the bottom) https://i.imgur.com/zIyjy0M.jpg

    Custom field settings https://i.imgur.com/nqNQK5N.png

    Code for frontend I’m using in comments template

    <?php
      $cfile = get_field('comment_file');
      if( $cfile ): ?>
        <a href="<?php echo $cfile['url']; ?>"><?php echo $cfile['filename']; ?></a>
      <?php endif;
    ?>

    The problem is – I can’t see file in frontend part of website. Like there is no file(s).

Viewing 1 post (of 1 total)

The topic ‘AFC – show files in comments’ is closed to new replies.