WordPress.org

Ready to get started?Download WordPress

Forums

images in theme files won't show (4 posts)

  1. achenn
    Member
    Posted 2 years ago #

    I'm trying to build a theme with a few hardcoded images- background, social share buttons, and logo.

    Live site.

    Here are examples of the code I'm using:
    index.php

    <div id="stay-in-touch">
    	<p>Stay in touch-</p>
    	<ul>
    		<li><a href="#"><img src="img/facebook.png" alt="Like on Facebook" /></a></li>
    		<li><a href="#"><img src="img/twitter.png" alt="Follow on Twitter" /></a></li>
    		<li><a href="#"><img src="img/linkedin.png" alt="Connect on LinkedIn" /></a></li>
    	</ul>
    </div><!-- end stay-in-touch -->

    style.css

    body {
    	background: url('img/background.png');
    	-webkit-background-size: cover;
    	-moz-background-size: cover;
    	-o-background-size: cover;
    	background-size: cover;
    	font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    }

    I thought maybe it was something to do with the host and permissions, but everything seems fine on that end. Any and all help is greatly appreciated.

  2. Chip Bennett
    Theme Review Admin
    Posted 2 years ago #

    In the template files, change this:

    src="img/facebook.png"

    ...to this:

    src="<?php echo get_template_directory_uri(); ?>/img/facebook.png"

    For the CSS URLs, your site is generating 403 permission denied errors:
    http://dyluxept.com/wp-content/themes/DyluxeFitnessCustom/img/background.png

    You'll need to figure out why. Could be file/directory permissions; could be something in .htaccess.

  3. achenn
    Member
    Posted 2 years ago #

    Ah, Chip you've saved the day once again. Thank you!

  4. achenn
    Member
    Posted 2 years ago #

    PS- The issue with the CSS URL was in the host's file permission settings. Bluehost is tricky.

Topic Closed

This topic has been closed to new replies.

About this Topic