Need help with php code to add videos
-
Hi, I currently use the plugin to add videos to galleries by adding the video code into a custom field text area for each gallery, this works great untill I want to adjust size or other setting on the video as I have to manually edit each gallery, and I have a lot of galleries.
What I’m trying to do is add the video code to gallery.php and then use a custom field to show it on selected galleries.
I’ve been trying this without success so far:<?php if (condition): ?> html code to run if condition is true <?php else: ?> html code to run if condition is false <?php endif ?>
But I dont know what to do for the condition.
So my custom field isnggcf_get_gallery_field($gallery->ID, "mp4")
and it is a drop down selection with just one option TRUE, I’m hoping that if the condition is not met TRUE it wont show, that way I don’t need to select false on galleries with no videos, this works with other custom fields I’ve done by just leaving them empty.
But how do I set the condition to show TRUE so it shows the video html?https://www.ads-software.com/plugins/nextgen-gallery-custom-fields/
- The topic ‘Need help with php code to add videos’ is closed to new replies.