Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I dont want the image to be a link

    I have tried many things and i cant get it to work. I either get an error or just the name of the image to display instead of the image. Can someone please help me find a solution to get rid of having images as link in my slider. Thanks

    PHP Code:
    <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>'; }
                            
    ?>    
                        </li>

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,092
    Thanks
    23
    Thanked 594 Times in 593 Posts
    It looks like this:
    Code:
    echo '<a href="'.get_permalink().'" title="'.the_title_attribute('echo=0').'">'.$img.'</a>';
    Should be:
    Code:
    echo $img;
    It's the only image I see in the code fragment.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •