• Resolved rw1

    (@rw1)


    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!

Viewing 1 replies (of 1 total)
  • Thread Starter rw1

    (@rw1)

    nevermind, i had to find a solution where the custom field value was not in the head area because it needs to be related to the changing slide content and therefore dynamic and not set in the header and i’m not totally there with a solution yet.

Viewing 1 replies (of 1 total)
  • The topic ‘how to dynamically define file in flashvars using php?’ is closed to new replies.