Title: [Plugin: Custom Field Template] Shortcode Format: using [Key] with php
Last modified: August 19, 2016

---

# [Plugin: Custom Field Template] Shortcode Format: using [Key] with php

 *  [kai-ser](https://wordpress.org/support/users/kai-ser/)
 * (@kai-ser)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-shortcode-format-using-key-with-php/)
 * Hey
 * I want to insert my own Flash Video Player into a post/page by using [cft format
   = 0)
 * The Cft Template looks like:
    [video] type = file relation = true
 * The format #0 looks like: (‘use php’ is checked)
 *     ```
       <div id="video-container"><object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="500" height="300">
       		<param name="movie" value="<?php bloginfo('template_url') ?>/video/player.swf" />
       		<param name="allowfullscreen" value="true" />
       		<param name="allowscriptaccess" value="always" />
       		<param name="flashvars" value="file=<?php echo wp_get_attachment_url('[Video]'); ?>" />
               <object type="application/x-shockwave-flash" data="<?php bloginfo('template_url') ?>/video/player.swf" width="500" height="300">
       		<param name="movie" value="<?php bloginfo('template_url') ?>/video/player.swf" />
       		<param name="allowfullscreen" value="true" />
       		<param name="allowscriptaccess" value="always" />
       		<param name="flashvars" value="file=<?php echo wp_get_attachment_url('[Video]'); ?>" />
   
       		<p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p>
       		</object>
       	</object></div>
       ```
   
 * Everything seems to work so far, except **<?php echo wp_get_attachment_url(‘[
   Video]’); ?> **
 * echo ‘[Video]’; returns the right attachment id, and if i exchange this id with‘[
   Video]’ like: wp_get_attachment_url(176) everything is fine.
    I’ve also tried
   to declare a new var with get_post_meta[…], tried to put [Video] in a new variable,
   tried to get the attachment id with other methods..but nothing worked, but i’m
   not a expert, and just might miss something.

Viewing 1 replies (of 1 total)

 *  Thread Starter [kai-ser](https://wordpress.org/support/users/kai-ser/)
 * (@kai-ser)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-shortcode-format-using-key-with-php/#post-1309097)
 * ok, now i’ve finally found an other way to get the attachment url, but still 
   no luck.
    now i have $mypath which stores the path to the file but <param name
   =”flashvars” value=”file=<?php echo $mypath; ?>” /> also does not work inside
   this shortcode…the other template tags do theit jobs..weird.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Custom Field Template] Shortcode Format: using [Key] with php’
is closed to new replies.

## Tags

 * [file upload](https://wordpress.org/support/topic-tag/file-upload/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 1 reply
 * 1 participant
 * Last reply from: [kai-ser](https://wordpress.org/support/users/kai-ser/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-shortcode-format-using-key-with-php/#post-1309097)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
