how to eliminate images as clickable links

Discussion in 'PHP' started by terry_bolo, Jul 15, 2013.

  1. #1
    Hello, I'm having issues with my slider because it showing images as clickable links and i want to disable it. I have tried a couple of thing but nothing works, can someone guide me in the right direction. Thanks

    <li class="slide">
    <?php
    if (has_post_thumbnail()) {
    $img = get_the_post_thumbnail($page->ID, 'slide', array( 'title' => trim(strip_tags( $attachment->post_title )) ) );
    } else {
    $img = '<img src="'.CHILD_URL.'/images/noimage940x350.png" alt="" title="'.$post_title.'" />';
    }
    echo '<a href="'.get_permalink().'" title="'.the_title_attribute('echo=0').'">'.$img.'</a>';
    $excerpt = get_the_excerpt();
    if (strlen($excerpt) > 120) {
    $excerpt = substr($excerpt,0,strpos($excerpt,' ',120)); }
    $excerpt = $excerpt.' ...';
    if (!empty($options['display']['captions'])) { echo '<div class="flex-caption"><div class="container"><h4>'. get_the_title() . '</h4><p>' . $excerpt .'</p></div></div>'; }
    ?>
    </l
    PHP:
     
    terry_bolo, Jul 15, 2013 IP
  2. scriptjerk

    scriptjerk Active Member

    Messages:
    43
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    58
    #2
    line 8

    echo '<a href="'.get_permalink().'" title="'.the_title_attribute('echo=0').'">'.$img.'</a>';
    Code (markup):
    Change to:

    echo $img;
    Code (markup):
     
    scriptjerk, Jul 15, 2013 IP
    EmmanuelFlossie and browntwn like this.
  3. terry_bolo

    terry_bolo Member

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    I cant believe it was that easy, thank you very much it worked.
     
    terry_bolo, Jul 15, 2013 IP
  4. EmmanuelFlossie

    EmmanuelFlossie Active Member

    Messages:
    159
    Likes Received:
    11
    Best Answers:
    2
    Trophy Points:
    65
    #4
    The reason why it's so simple is because a link is <a href="mylink.php"></a>

    Anything you wrap inside the anchor link is clickable.
     
    EmmanuelFlossie, Jul 15, 2013 IP