Custom layout for search result

In WordPress 3.5.1 I want to create & use custom layout to display search result. I googled and found http://codex.wordpress.org/Creating_a_Search_Page but this is not exactly what I want.

Related posts

Leave a Reply

1 comment

  1. Okay I solved my problem and now very happy 🙂

    I write following script in search.php file

    while ( have_posts() ) {
    
                    the_post();
    
                    //get_template_part( 'content', get_post_format() );
    
                    $permalink = get_permalink($post->ID);
                    $title = get_the_title($post->ID);
                    $feed = truncate( strip_tags( get_the_content($post->ID) ), 0, 300, "[...]");
    
                    echo '<div class="posts">';
                    echo '<div style="float:left">';
                    echo '<a class="featured-img">
                            '.the_post_thumbnail('thumbnail').'
                        </a>';
                    echo '</div>';
    
                    echo '<div class="posts-content">';
                    echo    '<div class="heading"><a href="'.$permalink.'">'.$title.'</a></div>';
                    echo    '<div class="comments">&nbsp;</div>'.
                            $feed
                            .'</div>';
    
                    echo '</div>';
                }