Forums

[resolved] Images and styles not showing up on theme (13 posts)

  1. rafa09
    Member
    Posted 1 year ago #

    Hi everyone,
    I created a simple wordpress theme. I uploaded the a folder with my them name to my GoDaddy server. When I log into my wordpress admin account, I can see my newly created them under "Available Themes". When I click on "Preview", I only get my content BUT none of my stylings or images. I guess my theme is not able to see my "style.css" or images located on my "images" folder. Any idea what I am doing wrong?

    The items on my theme folder are:
    images (a folder)
    Scripts (a folder)
    footer.php
    header.php
    index.php
    style.css

    Thank you in advance for your help!

    Rafa.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try reviewing Theme_Development.

  3. rafa09
    Member
    Posted 1 year ago #

    Hi esmi,
    Thanks for your quick reply. I think it has something to do with this:
    http://codex.wordpress.org/Theme_Development#Referencing_Files_From_a_Template

    I am not very familiar with wordpress yet (I am learning!), and can't figure our what they mean by that... Where am I supposed to write that? On the style.ccs or on the index.php?

    thank you,
    Rafa.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Both. Ensure that stylesheet path is correct. That images applied by CSS are correctly referenced in the stylesheet and that any included files within your theme folder use the TEMPLATEPATH constant.

  5. rafa09
    Member
    Posted 1 year ago #

    Hi esmi,
    To my knowledge, my stylesheet path is correct on "header.php", as follows:
    <link href="style.css" rel="stylesheet" />
    The CSS file is in the same level as "header.php".

    What is the TEMPLATEPATH constant? I searched on the link you provided, but nothing comes up for that. That must be what I am missing.

    Thank you for your help,
    Rafa.

  6. rafa09
    Member
    Posted 1 year ago #

    Esmi,
    I think I am a little closer. I added the lines:

    <title><?php wp_title('&laquo',true, 'right'); ?> <?php bloginfo('name'); ?></title>
    <link href="<?php bloginfo('stylesheet_url');?>" rel="stylesheet" type="text/css" media="screen" />

    Actually, I added the php details to these lines. Now my site IS showing some styling. BUT, I still don't get my images to show up... what am I doing wrong???

    thank you,
    Rafa.

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    <link href="style.css" rel="stylesheet" />
    That's incorrect. You should have a full url. The changes you made later should have fixed this.

    As for your images (and I'm assuming you;re referring to uploaded images), check your uploads path in Settings/Media.

  8. rafa09
    Member
    Posted 1 year ago #

    esmi,
    Thanks, the changes I added did indeed fix the css issues. Regarding the images, I am talking about images used on the site (for design purposes). I have images on "header.php" and "index.php" that are not showing up, as well as the ones used by "style.css". All these images are located on my "images" folder on the same level as the PHP and CSS files. Any ideay why?

    thank you,
    Rafa.

  9. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    If the images are in .php template files, make sure that you have used absolute (full) urls. Relative urls do not work well in WP. With CSS images, make sure that the paths you are using in the stylesheet are correct. If your CSS images are in your theme's images folder, you should be using something like background:url(images/example.jpg)

  10. rafa09
    Member
    Posted 1 year ago #

    I am having such a hard time trying to figure this our... On my "header.php" I have:

    <div id="designIcon">
            	<img src="images/3icons.jpg" />
     </div><!--end designIcon-->

    on my CSS file I have:

    #logo {
    	background:url(images/MTP_logo_top.jpg) no-repeat;
    }

    I understand there is a different way to reference the images in PHP (do you have an example? I can't find one). But I was using what you suggested for CSS, and they still don't show up... What am I doing wrong?

    thanks,
    Rafa.

  11. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    WRONG:

    <div id="designIcon">
            	<img src="images/3icons.jpg" />
     </div><!--end designIcon-->

    CORRECT

    <div id="designIcon">
            	<img src="<?php bloginfo('template_directory'); ?>/images/3icons.jpg" />
     </div><!--end designIcon-->

    I was using what you suggested for CSS, and they still don't show up

    Check that the MTP_logo_top.jpg is in the theme_name/images folder and is optimised for web use (ie uses standard and not progressive encoding).

  12. rafa09
    Member
    Posted 1 year ago #

    esmi!
    The images called upon by the CSS file are showing up. But none of the ones called upon by the PHP files. I replaced the code on the divs like you suggested. So I assume the issue has to do with standard vs progressive. I designed the theme using Photoshop + Dreamweaver. Everything showed up appropriately as HTML on IE, FireFox, etc. I don't understand why they do not show up correctly when the HTML is turned into PHP... any ideas?

    Again, thank you for your time and help,
    Rafa.

  13. rafa09
    Member
    Posted 1 year ago #

    esmi,
    I got it to work. I missed a "/" on the path to the images. I had:
    <img src="<?php bloginfo('template_directory'); ?>images/arrows.png" alt="Upload Artwork" />

    I missed the "/" at the beginning of the path...

    Again, thank you for your help.

    Rafa.

Topic Closed

This topic has been closed to new replies.

About this Topic