Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Images in a WordPress theme or child theme - several methods
<!-- in case of problems with displaying the images chmod 777 and chown daemon:daemon -->
<!-- link to media files -->
<p>
<img src="http://localhost/test/wordpress/wp-content/uploads/2015/03/cropped-download-1.jpg" width="200" height="*">
<p>
<!-- image in the template folder -->
<p>
<img src="<?php bloginfo('stylesheet_directory');?>/images/car.jpg"/ >
</p>
<!-- via CSS -->
<div id="anImage"></div>
<!-- the stylesheet -->
<style>
#anImage {
background-image: url(images/car.jpg);
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.