How to create a sidebar video stream uploaded by advertiser as part of ad
This almost works perfectly... it's just the last step I need help with.
What you need:
1. Download the plug-ins embedly and php code widget. Go to your plug-ins page in the main admin area and click on activate for both of them.
2. Create a field in your form layout so that your advertiser can paste in the embed code from a site like youtube, for their video. Call it something like video clip. Once it's been created, click on it and see what meta-name
WP has given it - it'll be something like cp_video_clip. Make a note of this.
3. Go to your widgets page (in Appearances). Find the widget called PHP Code and drag it into the box under the right hand heading called Ad Sidebar. Click on it to open it. You can give it a title like "Watch A Demonstration" or whatever is appropriate.
4. In the main body paste this code: <?php
global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'FIELDNAME', true);
?>
but remember to change FIELDNAME to the meta-name. Save it.
5. The advertiser goes to youtube, finds the video they want, clicks on the embed button, and then copies and pastes that code into the custom field of the classipress ad form. Get them to - or do it yourself afterwards - change the numbers that appear at the beginning of the code. These are the height and width of the video display. Change the first figure of 640 (or whatever) to 300, and the next figure of 385 (approx) to 220. Now it will fit the sidebar.
6. Publish their ad.
NOTE - Anytime that ad is edited, the video embed code has to be re-entered and the sizes corrected again. Not sure why, but every time you go to the edit page of the ad, most of the embed code has disappeared. It's a pain, but nothing serious.
HOWEVER ONE PROBLEM - and can someone PLEASE HELP...
Is there any way to make that field now invisible in the main ad? If you delete it then it won't show up in the sidebar either, but the problem remains that you now have 2 copies of the video - one in the sidebar, and one in the main body. Does anybody know how to make a command that says something along the lines of "if this field appears in the ad listing, make it invisible"?
Thanks