Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Don't know where to put this: I need a wordpress PHP guru to help me send some shoes to the Pres.

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » General Discussion Donate to DU
 
erodriguez Donating Member (532 posts) Send PM | Profile | Ignore Wed Mar-02-11 11:50 PM
Original message
Don't know where to put this: I need a wordpress PHP guru to help me send some shoes to the Pres.
I'm almost done with my site

http://comfortableshoesforobama.org/

But I am having trouble embedding this video on the header.

http://www.youtube.com/watch?v=SA9KC8SMu3o&feature=player_embedded

The issue is that it is a custom theme that takes an image from a post and puts it on the homepage header.
I want to get it to accept a video instead. Here is the code to display the image. Any suggestions how to change it to show the embedded youtube video instead?

# Displays post image attachment (sizes: thumbnail, medium, full)
function dp_attachment_image($postid=0, $size='thumbnail', $attributes='') {
if ($postid<1) $postid = get_the_ID();
if ($images = get_children(array(
'post_parent' => $postid,
'post_type' => 'attachment',
'numberposts' => 1,
'post_mime_type' => 'image',)))
foreach($images as $image) {
$attachment=wp_get_attachment_image_src($image->ID, $size);
?><img src="<?php echo $attachment<0>; ?>" <?php echo $attributes; ?> /><?php
}



If you don't have the time is there a forum that you would recommend me to ask?

Thanks in advance.
Printer Friendly | Permalink |  | Top
tabatha Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Mar-02-11 11:53 PM
Response to Original message
1. I use a plugin that makes it very easy to embed videos.
Edited on Wed Mar-02-11 11:57 PM by tabatha
Printer Friendly | Permalink |  | Top
 
Toucano Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Mar-02-11 11:56 PM
Response to Original message
2. I think that's for a slideshow of still images, not for a video.
Printer Friendly | Permalink |  | Top
 
salvorhardin Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Mar-03-11 12:19 AM
Response to Original message
3. Just replace all of that code with the YouTube embed code for that video
<iframe title="YouTube video player"
width="640" height="390"
src="http://www.youtube.com/embed/SA9KC8SMu3o"
frameborder="0" allowfullscreen></iframe>
Printer Friendly | Permalink |  | Top
 
salvorhardin Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Mar-03-11 12:21 AM
Response to Reply #3
4. If you want it to be able to grab videos inside posts you need to do something entirely different
You'd need to either put the YouTube video id in a special field and grab that or create a custom post type.
Printer Friendly | Permalink |  | Top
 
erodriguez Donating Member (532 posts) Send PM | Profile | Ignore Thu Mar-03-11 12:33 AM
Response to Reply #3
5. Hmm I tried replacing it and it broke the site for some reason.
Thanks though.
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Fri Apr 26th 2024, 09:37 PM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » General Discussion Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC