• Resolved Tabashira

    (@tabashira2)


    i wanted to show videos using short code in a template
    i used the follwing code

    <?php echo do_shortcode('[FMP width="1180" height="550"]https://mywebsite.com/video.mp4[/FMP]'); ?>

    this works great however i wanted to specify a custom video for each post
    that can be called through get_post_meta

    created an extra meta data named Video and set the value to the url
    and used this code
    <?php echo get_post_meta($post->ID, 'Video', true); ?>
    this works great getting the url alone but i can’t merge the two codes

    tried
    <?php $video = echo get_post_meta($post->ID, 'Video', true); ?>
    and replace the url with $video but failed

    any help would be appreciated ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • <?php $video = echo get_post_meta($post->ID, ‘Video’, true); ?> please change to <?php $video = get_post_meta($post->ID, ‘Video’, true); ?>

    Thread Starter Tabashira

    (@tabashira2)

    well changed the code to this :

    <?php $video = get_post_meta($post->ID, 'Video', true); ?>
    <?php echo do_shortcode('[FMP width="1180" height="550"]$Video[/FMP]'); ?>

    but still not working ????
    any ideas ???

    <?php echo do_shortcode(‘[FMP width=”1180″ height=”550″]’.$Video.'[/FMP]’); ?>

    Is this work?

    Thread Starter Tabashira

    (@tabashira2)

    thanks alot codingpet , that’s simply awesome
    works perfect ??

    ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘help with this code ??? echo $var’ is closed to new replies.