0

How to display results with title and summary description in landing page of search engine and make it as pagination?

If the user type the word "loan", all pages that have a loan word will display and there's a "Read more" link or button below the summary description?

I saw some post/answer here about this problem but I forgot the link.

0

You have to create a php file named search.php. Inside that file, write the code below:

<?php get_header(); ?>

<?php if( have_posts() ) : while( have_posts() ) : the_post(); ?>

    <article class="entry">
        <header class="entry-title">
            <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>            
        </header>
        <div class="entry-content">
            <?php the_content( 'Read More' ); ?>
        </div>
    </article>

<?php endwhile; ?>

<?php endif; ?>

<?php get_footer(); ?>
  • <?php get_footer(); ?> is missing at the end of my code. Please make sure you added this line after the line <?php endif; ?> – Saikat Dec 22 '14 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.