• When adding a picture to a post, I have the options to open the image in a new page/tab when clicked, or view it in the image attachment page (image.php).

    The problem is that when I click an image in a post, and it opens in image.php, the link back to the post is dead. The color is there, and it looks like a link, but no cursor change, and no action when clicked. That also goes for the link to the full size version of the image.

    The code looks like below, and the only thing I’ve changed is “Published” to “Publisert”, the same word in norwegian.

    printf( __( '<span class="meta-prep meta-prep-entry-date">Publisert </span> <span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', 'twentyeleven' ),
    									esc_attr( get_the_time() ),
    									get_the_date(),
    									esc_url( wp_get_attachment_url() ),
    									$metadata['width'],
    									$metadata['height'],
    									esc_url( get_permalink( $post->post_parent ) ),
    									get_the_title( $post->post_parent )
    								);

    Anyone else got this problem?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Lars Kristian H?ydal

    (@lkhoydal)

    As an example, here is a link to an image on my blog that’s in a post: https://www.cbook.no/2011/05/telttur-til-bjorkhylla/p1010060/

    Moderator bcworkz

    (@bcworkz)

    I am having the same problem. I’ve taken the page source as sent from my server to my browser and ran it through a html validator, there were no errors. This makes no sense, it appears to be completely legitimate HTML in my browser. Yet, no links. Weird.

    You are not crazy. It’s real.

    Moderator bcworkz

    (@bcworkz)

    Just figured it out, the links are inside <header> tags, which does not allow links apparently. Removing the <header> tags allows the links to work, but now the page formatting is messed up. More work with CSS now. Sigh.

    Edit: simply changing <header> to <div> seemed to solve all the problems.
    But no, links broken again. Now it really makes no sense.

    Moderator bcworkz

    (@bcworkz)

    OK, now I do have it. Problem is with overlapping invisible elements. Seems to hide the link from the cursor though the text is visible. Changing z-index simply caused the nav links on the right to fail. I finally narrowed the width of one element, with CSS, exposing the links on the left that were not working:
    #nav-single { width: 22%;}
    I placed this in my child theme’s style.css, the original rule is in twentyeleven/style.css, there is no width rule there at all, just positioning stuff.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Twenty Eleven Image Attachment Page’ is closed to new replies.