Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
$alt_text = get_post_meta( $id, '_wp_attachment_image_alt', true);
$output .= '<div class="pslide"><a href="' . $alt_text . '"><img src="' . $img_attr[0] . '" /></a></div>'; 

With the code i can get an image and alt text as url for each slide in my slider. Everything works just fine but unfortunately when i move my mouse over the image i can see something like this: 192.168.1.100/wordpress/www.youtube.com

How can i get rid of wordpress url ?

Thanks in advance !

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Always include http:// in your URLs. Change www.youtube.com in http://www.youtube.com/ or even better http://youtube.com/

If you forget the http:// then the data is being parsed like it is another page on your website rather than an external website, that's why you'll see 192.168.1.100/wordpress/www.youtube.com

share|improve this answer
    
Yes, my fault :) Thanks for the help !! –  user2587741 Oct 6 '13 at 21:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.