[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 = trueThe 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="https://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)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: Custom Field Template] Shortcode Format: using [Key] with php’ is closed to new replies.