WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Images and CSS won't load... sort of. (9 posts)

  1. anthonyiperez
    Member
    Posted 9 months ago #

    Greetings all, I've got a bit of a problem here and have absolutely no idea how to go about fixing it. I've searched and read through numerous articles both in the forums and on Google and, for the life of me, can't figure out what do to. The issue I'm having seems somewhat simple - no CSS images!
    I somehow managed to get a a couple images in style.css to work, but that's all. It appears that images with direct html links work just fine, but most of the images defined within style.css and my structure stylesheet won't load. Which leads to another issue - my alternative stylesheets won't load.
    When I enter the locations into the address bar, I can sometimes get to it. Other times I'll get a 404 error saying that the stuff doesn't exist. It just doesn't make any sense to me! Please help!!

  2. anthonyiperez
    Member
    Posted 9 months ago #

    Tried attaching the website address in there, guess it didn't work. Here's the website I've been trying to get functioning properly for my wife.

    http://www.healthbabe.org

  3. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

    How are you uploading these images - these file paths are not normal:

    http://healthbabe.org/wp-content/themes/HBCustom/images/JPEG/grassbackground.jpg
  4. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

    You should also use absolute file paths in the CSS - WP doesn't work well with relative file paths.

  5. anthonyiperez
    Member
    Posted 9 months ago #

    Hey WPyogi, thanks for the quick reply! Grassbackground is being loaded with the following code:

    body
       {
       margin-top:0;
       padding: 0;
       margin: 0;
       vertical-align: top;
       text-align: left;
       color: #EEE8AA;
       background: url(images/JPEG/grassbackground.jpg) fixed repeat-x bottom center;
    
       }

    That is the only image from style.css that is actually loading. The logo and social media icons are loaded with html.

  6. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

    Yes, you need to upload the images using the media uploader and then use the full (absolute) file path in the CSS code.

  7. anthonyiperez
    Member
    Posted 9 months ago #

    All the images exist within the folder already though. After building the templates and stylesheets, I zipped and uploaded the custom theme to wordpress and everything just stopped working properly. All the images can be found at http://healthbabe.org/wp-content/themes/HBCustom/images/
    However, when you navigate to the same link, sans images, this error is shown:
    Fatal error: Call to undefined function get_header() in /home/healt288/public_html/wp-content/themes/HBCustom/index.php on line 1

  8. Andrew Nevins
    Barrel Rider, Spam Zapper & Volunteer Moderator
    Posted 9 months ago #

    You can find the issue if you just use a spot-the-difference technique; spotting the difference between the path to your image that is there:

    http://healthbabe.org/wp-content/themes/HBCustom/images/PNG/Header.png

    And then the image that is not found:

    http://healthbabe.org/wp-content/themes/HBCustom/images/PNG/header.png
  9. anthonyiperez
    Member
    Posted 9 months ago #

    Mr. Nevins, I love you. The slightest little details can wreak havoc on pages apparently. Thank you for your suggestion, the site is now working just the way it was intended! I just gotta tweak it a little bit and everything should look the way it did on localhost.

    Again, thanks a ton man.

Reply

You must log in to post.

About this Topic