Forums

Show thumbnail title (1 post)

  1. ishaper
    Member
    Posted 4 months ago #

    Hi guys,

    I am trying to show a title above each thumbnails. But I can't work it out. I hope somebody could help me.

    <div id="autos">
    
    <?php
      $thumbnails = get_posts('numberposts=8');
      foreach ($thumbnails as $thumbnail) {
        if ( has_post_thumbnail($thumbnail->ID)) {
          echo '<a href="' . get_permalink( $thumbnail->ID ) . '
    ' . esc_attr( $thumbnail->post_title ) . '"><IMG SRC="http://irijden.nl/wp-content/uploads/2012/01/border1.jpg" ALT=""WIDTH=40 HEIGHT=100>';
    
          echo get_the_post_thumbnail($thumbnail->ID, 'thumbnail' );
    
          echo '</a>';
    
        }
      }
    ?>
    
    </div>

    PS the website is : http://www.vdhurkautomotive.nu

Reply

You must log in to post.

About this Topic