how to dynamically define file in flashvars using php?
-
hello,
in the head area of my wordpress theme’s header.php i am defining the flashvars of a video player like this:
<script type="text/javascript"> var flashvars = { 'file': '<?php echo get_post_meta(get_the_ID(), 'custom_field', true); ?>', 'stretching': 'fill', 'id':'playerID', 'autostart':'true'};
where the ‘custom_field’ of the post contains the url to a video file.
and on a blog post that contains this field, it is outputting the url to the file correctly in the source code.
on the home page however i have a slider style area where the latest posts are displayed and horizontally scrolled through automatically.
the titles of these ‘slides’ are generated dynamically with:
<h1><span><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></span></h1>
so it is therefore able to grab the title for whatever slide is showing.
so my question is how do i grab the ‘custom_field’ for whatever slide is showing so that it can populate the flashvar file option and thus launch a different file depending on what slide is showing?
thanks!
- The topic ‘how to dynamically define file in flashvars using php?’ is closed to new replies.