Skip to content

Instantly share code, notes, and snippets.

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 -->
<img src="http://localhost/test/wordpress/wp-content/uploads/2015/03/cropped-download-1.jpg" width="200" height="*">
<!-- image in the template folder -->
<img src="<?php bloginfo('stylesheet_directory');?>/images/car.jpg"/ >
<!-- via CSS -->
<div id="anImage"></div>
<!-- the stylesheet -->
#anImage {
background-image: url(images/car.jpg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment