wordpress get_template_directory

I have the following code, what I am expecting it to do is locate the theme I am using and place that path before the /images/bg.png so far I just get the location which is localhost/nameoffolder/images/bg.png but what i want is localhost/nameoffolder/wp-content/themes/images/bg.png

<img src="<?php get_template_directory(); ?>/images/bg.png"></img>

this is the directory I would like to display http://localhost:8888/fiftyfity/wp-content/themes/fiftyfity/images/

Answers


I used this code instead and it worked

<img src="<?php bloginfo( 'template_directory' ); ?>/images/bg.png"></img>

Need Your Help

How can I reduce the number of arguments I have to pass around in Haskell?

haskell gtk glade

I'm very slowly getting up to speed in Haskell, trying to get a gui toolgit usable, etc. I followed a basic tutorial on using glade to create a simple GUI app and now I'm trying to modularize it. In

Jquery Change background colour on Nav link mouseover

javascript jquery css background mouseover

I want to change the color of background when I hover on different links in my nav menu. Say, link one.. the background goes to red, nav 2 the background goes to blue, nav 3 the background goes to ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.