How to add images to a wordpress theme when working on MAMP?

Sophie picture Sophie · Jan 17, 2012 · Viewed 53k times · Source

I am new to MAMP and I am developing a theme I designed. However I can't seem to get the images to render. I am using a clear theme I got from starkerstheme.com When adding an image directly to the code I used:

<img src="<?= $theme ?>/images/logo.png"/>

But the image is not showing up, also I tried to add it to the media library and it's still not rendering.

Answer

Robert Zeln&#237;k picture Robert Zelník · Sep 5, 2012

This works for me:

<img src="<?php echo get_bloginfo('template_url') ?>/images/logo.png"/>

See get bloginfo() function for more info.