• Hi there people!
    Can anyone help me add an image to the single.php file so that it displays at the bottom of every post? At the moment, i just have words with a border and no image. In addition, it needs to keep the ‘get first link’ function i have at the moment (which works). The image remains the same but obviously the link changes with every post.
    Here’s what i have so far:

    [please mark your code using the ‘code’ button]

    <div align="left">
    <div style="padding-left:5px; padding-right:5px; padding-bottom:10px; padding-top:10px; ">
    <?php $first_link = get_first_link(); ?>
    <a href="#" target="_blank"><img src="/images/white-avail-on-itunes.png" alt="<?php the_title(); ?> Is Available Here On The iTunes Store" /></a>
    </div>
    </div>

    So in short, im after a way of getting an image to show at the bottom of every post which keeps the link attached to it.

    Thank you for any help in advance ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • try and use the absolute path to the image:

    "><img src="<?php bloginfo('stylesheet_directory'); ?>/images/white-avail-on-itunes.png" alt="<?php the_title(); ?> Is Available Here On The iTunes Store" />
    Thread Starter marcus_m06

    (@marcus_m06)

    Hmmm… you’ve pretty much just solved my problem! ??

    1 thing though… how to i get rid of the border that displays around it? This border appears to show at the bottom of my website around the social icons (which i cant position properly by the way)

    i assume that some post/site images (or at least the linked ones) have a border;

    can you post a link to your site, pointing to the new image?

    and what is wrong with the position of the social icons?

    Thread Starter marcus_m06

    (@marcus_m06)

    Managed to change the image border (changed from 10px to 2px:
    .entry a img {border:2px solid #d4d4d4; }

    but the linked ones around the social icons at the bottom of the page are still there. The social icons appear to be absolute right or something because i cant get them to pad out or align them properly…

    https://www.officialiphoneapp.com

    thanks for your help ??

    Thread Starter marcus_m06

    (@marcus_m06)

    Even using the absolute path of the image, the image now no longer shows in firefox 4… any suggestions?

    Thread Starter marcus_m06

    (@marcus_m06)

    ok… just checked the above on firefox, opera, IE AND Chrome… the two images only show in Safari. Defo must be the coding but i have no idea how to fix this. Any help would be appreciated.

    I’ve also just checked with a real time HTML editor and it appears the be the <a href="<?php echo $first_link; ?>" part that the browsers don’t like. Is there another way of attaching the first link in the post to the picture?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Adding an image to single.php…but with a twist’ is closed to new replies.