Title: help with this code ??? echo $var
Last modified: August 20, 2016

---

# help with this code ??? echo $var

 *  Resolved [Tabashira](https://wordpress.org/support/users/tabashira2/)
 * (@tabashira2)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/help-with-this-code-echo-var/)
 * 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"]http://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)

 *  [codingpet](https://wordpress.org/support/users/codingpet/)
 * (@codingpet)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/help-with-this-code-echo-var/#post-2980361)
 * <?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](https://wordpress.org/support/users/tabashira2/)
 * (@tabashira2)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/help-with-this-code-echo-var/#post-2980367)
 * 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 ???
 *  [codingpet](https://wordpress.org/support/users/codingpet/)
 * (@codingpet)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/help-with-this-code-echo-var/#post-2980369)
 * <?php echo do_shortcode(‘[FMP width=”1180″ height=”550″]’.$Video.'[/FMP]’); ?
   >
 * Is this work?
 *  Thread Starter [Tabashira](https://wordpress.org/support/users/tabashira2/)
 * (@tabashira2)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/help-with-this-code-echo-var/#post-2980370)
 * thanks alot codingpet , that’s simply awesome
    works perfect 🙂
 *  [codingpet](https://wordpress.org/support/users/codingpet/)
 * (@codingpet)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/help-with-this-code-echo-var/#post-2980373)
 * 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘help with this code ??? echo $var’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [codingpet](https://wordpress.org/support/users/codingpet/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/help-with-this-code-echo-var/#post-2980373)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
