Support » Fixing WordPress » Show only thumbnails in a grid view on WP Search Results Page

  • Hi all,

    i am not a pro in wordpress at all, but i learned a lot in these forums and on the internet by tutorials about programming and wordpress. But i didnt find a solution for my current question.

    I want to show only thumbnails on the wordpress results page, no excerpts and stuff at all. The thumbnails should link to posts and pages and look like a gallery grid view. If there is no thumbnail, the results should not be shown.

    You can find the current code of my search.php below.

    My first idea is to just cut away the things which dont belong to the thumbnail. But then the style of the page just doesnt look good, because the thumbnails aren’t in a row. Maybe you have an idea?

    <h2 class="pagetitle">Suchergebnisse</h2>
    <?php while (have_posts()) : the_post(); ?>
    <div <?php post_class('post') ?>>
    <?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(260,200), array("class" => "alignleft post_thumbnail")); } ?>
    <h2 class="title" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <div class="postdate"><img src="<?php bloginfo('template_url'); ?>/images/date.png" /> <?php the_time('F jS, Y') ?> <?php if (current_user_can('edit_post', $post->ID)) { ?> <img src="<?php bloginfo('template_url'); ?>/images/edit.png" /> <?php edit_post_link('Edit', '', ''); } ?></div>
    <div class="entry">
    <?php the_excerpt() ?>
    </div>
    <div class="readmorecontent">
    <a class="readmore" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">Zum Artikel ยป</a>
    </div>
    </div>
    <?php endwhile; ?>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Show only thumbnails in a grid view on WP Search Results Page’ is closed to new replies.