I'm working on a theme index.php and it seems that when I use the "template_directory" it is not actually pulling the url path of the file, but instead is just pulling the main domain name. So instead of

http://example.com/wp-content/themes/theme_name/images/pic.jpg

its pulling the domain url and showing this

http://example.com/images/pic.jpg

I don't understand why it's doing this, since the index.php file is actually in the right directory. (which is inside the theme folder). There is the index.php file that is in the wordpress directory... but I don't understand why it would conflict with the themes index.php file.

The bloginfo() template tag already echoes its result; you don't need to echo it explicitly. bloginfo()echoes its result, while get_bloginfo()returns its result. Also, I strongly recommend using get_template_directory_uri() in place of get_bloginfo( 'template_url' ).
–
Chip BennettOct 3 '11 at 12:58