WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Images not showing up in page template

[Resolved] Images not showing up in page template

  • BanditSiix
    Member

    @banditsiix

    I created a page template in html and saved it as a php file.

    I uploaded the respective images associated with that page to the images folder under the specific theme I am using.

    When I publish the page it shows up fine with the exception of the header and border images (different than default theme).

    How can I get the images to show up. I tried making the img src direct to the actual images folder but still no luck.

    This is the page http://mylocalinteractive.com/super-leads/
    I’m using it as a landing page.

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Clayton James
    Participant

    @claytonjames

    I tried making the img src direct to the actual images folder but still no luck.

    This is the URI for the header image;

    //mylocalinteractive.com/wp-content/themes/1700/images/header_top2.gif

    This is what you currently have;

    //mylocalinteractive.com/wp-admin/themes/1700/images/header_top2.gif

    BanditSiix
    Member

    @banditsiix

    That was pretty lame of me. I did go and change the wp-admin to wp-content and now the header image is showing up but none of the border images or background are showing up. Am I just that blind that I’m not pointing to the right place?

    I really appreciate the 2nd set of eyes and the tips.

    Thanks.

    BanditSiix
    Member

    @banditsiix

    Anyone able to see why some of my images are not showing up. Specifically the background image and the page border images. I corrected the URI’s for each of them and verified the images are in fact in that location.

    oh, by the way I changed the permalink to http://www.mylocalinteractive.com/superleads

    It’s not the one listed above anymore.

    Thanks.

    nyliferocks
    Member

    @nyliferocks

    Same problem. I uploaded a custom page and the images do not show. They are linked correctly.

    I am also having this problem, and have checked multiple times that the images are linked correctly. If it helps, I am running WordPress 2.8.1 with the Corporate Sandbox theme.

    I just created another post describing a similar (but more involved) issue. Here it is:

    I wanted to go a little more in depth here. I’ve created a static homepage that will show a series rotating background images. When I set a background image in the css, it loads said image on the homepage. However, when I try to embed the file in the php as such:

    <img src=”images/background1.jpg”/>

    I get nothing. To further complicate matters, I am planning on using jQuery for this task, specifically the plugin called Supersized. I created a page called “supersized.php” and loaded that independent of WP for testing, and it works flawlessly. However, I added the snippet:

    <?php include(‘supersized.php’);?>

    into my custom template page and the CSS functions properly but none of the images load. I am just getting back into WP, and don’t know much PHP, but I am rather comfortable with CSS and HTML. It seems to me there is conflict with WP and using <img src/> tags. Can anyone confirm or deny this?

    Also, I am testing locally so unfortunately I can’t provide a link for viewing. I can provide additional code or try to explain my process better if needed.

    I am running WP 2.8.1 with the Corporate Sandbox theme.

    Thanks much,
    Eric

    Here’s a solution, thanks to t31os_ re: my other post:

    I never used stylesheet directory, i always use (not that it should matter).
    <?php bloginfo(‘template_directory’); ?>/images/someimage.gif

    Such a path resolves to ..
    http://www.yoursite.com/wp-content/themes/YOURTHEME/images/someimage.gif

    EMG
    Forum Volunteer

    @emg

    In other words, due to permalinks, one should always use WP-specific coding like what t31os recommended to display images to ensure that no matter the permalinks, the image links will always be correct as the images will always be retrieved from the appropriate directory. 🙂

    I was having this same problem. Background image references in my stylesheet weren’t being seen. I figured it out. erow80 had a comment above that contained, “I never used stylesheet directory…”

    That sparked something. I DO use stylesheet directories and here’s the solution. You have to think of where the current stylesheet is located in relation to the image file. Here’s my directory setup.

    (my stylesheet…)
    mytheme-name/style/css/stylesheet.css

    (my background image…)
    mytheme-name/style/images/bg.jpg

    I was using url(style/images/bg.jpg) and getting nothing. I realized that I have to reference the image file from the where the css file is located.

    The corrected reference based on this structure is url(../images/bg.jpg)

    I hope this makes sense and helps…

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Images not showing up in page template’ is closed to new replies.