Forums

custom wordpress search result page (2 posts)

  1. sunraise2005
    Member
    Posted 3 years ago #

    how to let search result page only show post title ? Current search result page at wordpress show the content of the post, it will be a difficult if there are many posts hits the search.

  2. blogsdna
    Member
    Posted 3 years ago #

    is very easy to create such search page you just need of knowledge of wordpress template tags and theem files.

    You can create new search.php file with fllowing code

    <?php get_header(); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<h2 class="post-title">
    	" rel="bookmark"><?php the_title(); ?>
    	</h2>
    <?php endwhile; else: ?>
    <div class="entry"><h2><?php _e('Sorry, no posts matched your Search criteria.'); ?></h2></div>
    <?php endif; ?>
    <?php get_footer(); ?>

    This is just a php code you need to put your theme style code to apply proper styling an formating to search result page.

Topic Closed

This topic has been closed to new replies.

About this Topic