WordPress.org

Ready to get started?Download WordPress

Forums

Where to upload images? (7 posts)

  1. Flashyx
    Member
    Posted 1 year ago #

    Hi guys, im new to this.

    Im tearing my hair out here, I'm trying to upload a custom template (which is working) however the images never show up!! its driving me crazy, i feel like ive looked everywhere cant seem to find the answer.

    im uploading my homepage.php file to the themes folder all ok
    (im uploading here: /public_html/wp-content/themes/twentyeleven)

    i then go to put my images in the images folder but they dont show up in the website:
    (Im uploading images here: /public_html/wp-content/themes/twentyeleven/images)

    ahhhh! what am i doing wrong!!?

    any help would be great

  2. cassihl
    Member
    Posted 1 year ago #

    Are you uploading the images via ftp, or through the Media upload in the wordpress admin area? If you're uploading through the media upload page, the images will go here: /public_html/wp-content/uploads/2012/08

    If you're uploading via ftp, are you referencing the url correctly to display the image? Try something like this: src="<?php bloginfo('template_directory'); ?>/images/filename.jpg"

  3. Flashyx
    Member
    Posted 1 year ago #

    Hi cassihl,

    thanks so much for your help. Im still stuck though :( im using ftp to upload my images and templates.

    ive tried uploading both my homepage.php and salt.jpg to the following areas but the image still doesnt show but the homepage.php does :/

    attempt 1:
    /public_html/wp-content/themes/twentyeleven/homepage.php
    /public_html/wp-content/themes/twentyeleven/images/salt.jpg

    attempt 2:
    /public_html/wp-content/themes/twentyeleven/homepage.php
    /public_html/wp-content/themes/twentyeleven/salt.php

    attempt 3:
    /public_html/wp-content/themes/twentyeleven/homepage.php
    /public_html/wp-content/themes/twentyeleven/salt.php
    with....
    <img src="<?php bloginfo('/public_html/wp-content/themes/twentyeleven'); ?>/images/filename.jpg"/>

    no luck. any other suggestions? is that the syntax you meant for the src?

    thanks again.

  4. cassihl
    Member
    Posted 1 year ago #

    On this part:

    <img src="<?php bloginfo('/public_html/wp-content/themes/twentyeleven'); ?>/images/filename.jpg"/>

    You need to just use this tag:
    <?php bloginfo('template_directory'); ?>
    Don't replace 'template_directory' with anything, just keep it as is.

  5. Flashyx
    Member
    Posted 1 year ago #

    Hi again Cassihl,

    sorry i havnt gotten back to you sooner, been chaos at work at the moment.

    so the line should be:
    <img src="<?php bloginfo('template_directory'); ?>/images/salt.jpg width="470" height="331" />

    im attempting it now but my ISP is conveniently down at the moment so ill have to wait :(

    cheers

  6. Flashyx
    Member
    Posted 1 year ago #

    ok, its back online..

    still no luck :(

    I have my files set in the themes folder here as follows:
    /public_html/wp-content/themes/twentyeleven/homepage.php
    /public_html/wp-content/themes/twentyeleven/images/salt.jpg

    and this is the code i used in my homepage.php file:
    <img src="<?php bloginfo('template_directory'); ?>/images/salt.jpg width="470" height="331" />

    my website example is here:

    http://aidenkongas.com/

    what am i doin incorrectly? *tears*

    cheers

  7. Flashyx
    Member
    Posted 1 year ago #

    not to worry, i figured it out, its always a typo, doh!!

    missed out on the quotation marks :/

    should be:
    <img src="<?php bloginfo('template_directory'); ?>/images/salt.jpg" width="470" height="331" />

    thanks for all your help cassihl :)

Topic Closed

This topic has been closed to new replies.

About this Topic