• Resolved paundrew

    (@paundrew)


    I am having difficulty adding a hyperlink to images accompanying latest posts. This is basic functionality and I am at a loss as to why it is not working. I have tried several coding solutions, all major browsers, different workstations, and think I might be missing something obvious. Either that, or WordPress is handling images differently in the latest section. Curiously linking seems to work well in every other area of the site, and the coding and css is identical.

    Currently, the image urls are added as custom fields, and then called at the beginning of the latest post

    I have tried several different coding fixes, none of which have worked:

    <!– ” title=”<?php the_title_attribute(); ?>”><img src=”<?php $values = get_post_custom_values(“image”); echo $values[0]; ?>” alt=”” class=”latest-image”/> –>(without the comment indicators)

    I have also tried using

    <?php $image = get_post_meta($post->ID, ‘image’, true); ?><?php echo $image; ?>

    As well as embedding the image in the excerpt and linking it directly. None of these have worked, although the generated source code correctly names the image. For example, the first code example above correctly generated:

    <!–
    <img src=”https://littlebobeeeep.com/wp-content/uploads/2009/12/sotc1.jpg&#8221; alt=”” class=”latest-image”/> –>

    Does anyone know where I might start looking for an answer? I feel like difficulty with such a basic issue must have been encountered by others.

    Thanks in advance,

    Paul

Viewing 6 replies - 1 through 6 (of 6 total)
  • Is your site supposed to have four e’s in the word ‘beep’, because spelled with two e’s it seems to work.

    It’s not an issue with the WP code as it seems to be outputting the image & link correctly, it’s to do with HTML & CSS.

    Either remove position:relative; from .latest-content or add:

    .latest-content{overflow:auto;}

    It’s not an issue with the WP code as it seems to be outputting the image & link correctly, it’s to do with HTML & CSS.

    But… this works…

    https://littlebobeep.com/wp-content/uploads/2009/12/sotc1.jpg

    … which is not the img src link provided. And this doesn’t work…

    https://littlebobeeeep.com/wp-content/uploads/2009/12/sotc1.jpg

    … which is the img src link provided. The same is true of the page URL given. This works– https://littlebobeep.com/?p=171&#8211;; this doesn’t — https://littlebobeeeep.com/?p=171.

    Maybe the original poster intentionally screwed up the url, but even so, when I cut those two e’s out I see plenty of images and when I don’t cut them out– well, there just isn’t anything there. “…can’t find the server at https://www.littlebobeeeep.com.&#8221;

    Thread Starter paundrew

    (@paundrew)

    Thanks for your help apljdi, but the problem is not that the images aren’t working, its that the hyperlinks on the frontpage are not working. I want the images on the home page to be clickable. They are not.

    xdesi, thanks for the tip. That’s the same train of thought I had – the urls are being correctly generated. I’ll apply your suggested changes and let you know.

    OK. You have a z-index problem. That is, the image is there and it is properly hyperlinked, but some other element completely overlays it making it inaccessible. Put a position:relative; and a z-index greater than 0 on that image and the hyperlink will work.

    Thread Starter paundrew

    (@paundrew)

    Thanks guys, It was the position:relative style. Problem Solved!

    Best,
    p

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Front page latest images wont hyperlink correctly. Bug?’ is closed to new replies.