![]() |
PHP and wp custom fields ahhhhhhhhhhhhhh help
I´m fucking about in wp with custom fields calling the video url for the flowplayer plugin and I´m getting Parse error: syntax error, unexpected T_STRING on.....
Code:
<?phpCode:
<?php flowplayer('[flowplayer src=/videos/example.flv]'); ?>so I assumed its because I´m calling php again on the echo.. I tried Code:
<?php flowplayer('[flowplayer src=echo get_post_meta($post->ID, '_wpb_video', true)]'); ?>it´s not pulling the echo so I tried $string This doesn´t break anything I actually get the page but it pulls echo as the filename Code:
<?phpCode:
<?phpwhich gives me Code:
flowplayer('[flowplayer src=echo get_post_meta(142, '_wpb_video', true)]')so do I need to include <?php and ?> in the string? and it so how? or how do make it so it s doesnt post the code within "" if I do something like Code:
<?phpBut because of my limited php knowledge thats me stuck.. anyone got any ideas. |
Code:
flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, \'_wpb_video\', true); ?>]'); |
Quote:
|
Did you actually echo the function??
|
wow that was quick.. thx for the replies.
Quote:
Code:
<?php flowplayer('[flowplayer src=videos/example.flv]'); ?>foliovision. com/seo-tools/wordpress/plugins/fv-wordpress-flowplayer and works, it´s when I start messing with the content, switching it to pulling from a custom field it all goes pear-shaped and that is getting pulled on an echo. Code:
<?php flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, '_wpb_video', true); ?>]'); ?>I tried Code:
]<?php flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, \'_wpb_video\', true); ?>]'); ?>Quote:
|
Something like this should work php wise :
<?php $postMeta = get_post_meta($post->ID, '_wpb_video', true); ?> flowplayer('[flowplayer src=<?php echo $postMeta ?>]'); |
<?php
flowplayer('[flowplayer src=<?php echo get_post_meta($post->ID, '_wpb_video', true); ?>]'); ?> You're getting the parse error because you are trying to php echo inside an already open php call.. Try to concatenate the strings instead. :upsidedow |
Quote:
Code:
flowplayer('[flowplayer src=/2/2E/2EBBC2H3H0/8/0/7/1/c11708/fb43ba21e2/11708_01/01/11708_01_120sec_00.mp4]');Quote:
Serves me right for trying to be clever.. hehe. |
Solved it :GFYBand
Code:
<?phpthis works. |
| All times are GMT -7. The time now is 03:35 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123