Support » How-To and Troubleshooting » How to embed a Youtube Video on the User description?

How to embed a Youtube Video on the User description?

  • Hi,

    I have to create the users/writters descriptions on my blog and I would like to embed a Youtube Video I’ve made for each one.

    When I paste the link of the video in the description, nothing happen.. I only see the link in text…

    I use the plugin wp-youtube-lyte for my posts and pages but how I can work with Users?

    Do I have to install an other plugin? I should create a page or what?

    Thx in advance…

Viewing 3 replies - 1 through 3 (of 3 total)
  • tigtog


    You will probably need to do a bit of mucking around with both your user.php template and your functions.php file to insert the relevant video for each user in their user description field.

    It’s my bedtime an hour ago, so I can’t give you more than that general pointer right now.

    The problem is this :

    1- I can have new users everytimes, so I can’t go in my user.php and do some if(user = “Your name”){ echo ‘Youtube’}

    2- The “User description” generate text only… no HTML

    I tried the shortcode [youtube] and it didn’t work as expected.. When I check on the page, I see something like this : [youtube=http://www.youtube.com/watch?v=XXXXXXXXX-X]

    Any clues?

    Found a solution

    Here’s how I did to place a Youtube video on my Author page

    Step 1
    You need to enter the Youtube share link into a field in the administration… I used Jabber / GTalk and change the title for “Youtube Link”

    Step 2
    In your author.php file, you need to get the value of the above field and call it into a variable.

    $link = $curauth->jabber;
    $pieces = explode("/", $link);

    This part of code use a specific function found on the web to retrive some information…
    If I echo $link, I get this http://youtu.be/XXXXXXX-XX for exemple.
    Then after, with the explode PHP function, I explode in array the text everytimes it founds a /

    $pieces[0] = http:
    $pieces[1] =
    $pieces[2] = youtu.be
    $pieces[3] = XXXXXXX-XX

    The $pieces[3] is the one I actually search.

    Step 3
    Call your iframe and echo the $pieces[3] into the link.
    <iframe width="560" height="349" src="http://www.youtube.com/embed/<?php echo $pieces[3]; ?>" frameborder="0" allowfullscreen></iframe>

    Hope this help some one!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to embed a Youtube Video on the User description?’ is closed to new replies.
Skip to toolbar