• Resolved Mike-bd

    (@mikekharisma)


    I’m using the following code in my search loop results to create links from the thumbnail and title to the full post page.

    a href=”?php echo get_permalink($value->ID) ?
    ?php
    $args = array(
    ‘post_type’ => ‘attachment’,
    ‘post_mime_type’ => ‘image’,
    ‘post_parent’ => $post->ID,
    ‘alt’ =>$title
    );
    $images = get_posts( $args );
    foreach($images as $image):
    echo wp_get_attachment_image($images[0]->ID, ‘post-thumbnail’, false);
    endforeach;
    ?
    /a
    a href=”?php echo get_permalink($value->ID) ?”
    h23 ?php echo the_title(); ? /h23
    /a

    (i’ve lost all the <>’s so the code prints)

    The result is obviously an active Thumbnail and post titler, but on both links the active clickable area is literally a thin line at the bottom border of the image and a thin line at the top border of the title area, not the whole area of the picture/title that it should be. This is the same on every browser.

    I’ve tried making span areas, divs,… but nothing works? Any clues??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Mike-bd

    (@mikekharisma)

    Even if I slot a standard http address into the HREF, I still have the same problem.

    Standard called active images within the page work fine? It seems something to do with an active area being created with a PHP post request?

    Thread Starter Mike-bd

    (@mikekharisma)

    It’s funny how you always look for the most complicated explanation.

    Answer nothing to do with the confusing results I was getting, but the ghost of a relatively moved div, still sitting over the active div.

    So moving a div via position relative, doesn’t necessarily move every attribute!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using permalink and a PHP active A HREF’ is closed to new replies.