Field displays content of latest post for all posts on archive page
-
Hi, I’m having some trouble using this plugin to display the custom field content from multiple posts on the archive. I’m creating a media hosting site and the trailers are accessed by clicking on a button on the archive which opens a lightbox containing that trailer. My theme uses a template part content-box to display the posts on the archive page, and this is where I’ve included the php to link to the trailer, though I’ve had to use <?php echo do_shortcode to get it to display the video, rather than just the url of the video.
Does this plugin support multiple instances of the same field for different posts on the archive page?
For some reason, no matter which post’s trailer button I click on, the video is always the video if the latest post, rather than the video for that post.
here is the code I used in my template part:
<div class="trailer-button"> <a href="#" data-featherlight="#trailer-lightbox"><p>Trailer</p></a> <div id="trailer-lightbox"> <?php echo do_shortcode('[types field="trailer" autoplay="on" width="1280" height="720"][/types]'); ?> </div> </div>
- The topic ‘Field displays content of latest post for all posts on archive page’ is closed to new replies.