Viewing 7 replies - 1 through 7 (of 7 total)
  • What was I having so many issues with?

    So you were able to use Advanced Custom Fields as the way to upload the video file?

    I did (and do) use Advanced Custom Fields to upload video files. This requires knowledge of custom templates and some PHP (which you may already have… I don’t know your knowledge level).

    Hey @adam, would you be so kind and offer some advice on how one would go about using ACF with this plug-in so shortcodes would no longer be needed. I have very good technical skills but limited php knowledge. I would love to be able to add a video from my media library or upload a new video directly into a post or page utilising the videojs plugin without having to use shortcodes. Much appreciated.

    @mrdb – Using ACF, you’d have to first create a custom field in which the video file will be added, and also a poster (still) image custom field for the video. After that, the theme template where that field will be called will need some PHP code placed into it:

    <?php $k++; ?>
    <?php echo do_shortcode('[video id="videojs-'.$k.'" mp4="'.get_sub_field('your_acf_video_file_field').'" poster="'.get_sub_field('your_acf_video_file_poster').'"]'); ?>

    You’re basically using a native WP function (do_shortcode) to call the VideoJS plugin’s video shortcode within a theme template.

    Need some more info on ACF? Visit the ACF Resources page.

    Thanks Adam, appreciate your efforts.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Works Perfectly’ is closed to new replies.