Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Modifying search results look and feel in WordPress?

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 148
    Comment on it

    Wordpress themes includes different files for different purpose like single.php for showing the single post. We make the changes in search.php to modify the look and feel of the search results. You can see this file in default wordpress themes and we can also create this file in your own theme.


    By default search.php includes following script:-

    <?php
    /**
     * The template for displaying Search Results pages
     *
     * @package WordPress
     * @subpackage Twenty_Thirteen
     * @since Twenty Thirteen 1.0
     */
    
    get_header(); ?>
    
        <div id="primary" class="content-area">
            <div id="content" class="site-content" role="main">
    
            <?php if ( have_posts() ) : ?>
    
                <header class="page-header">
                    <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentythirteen' ), get_search_query() ); ?></h1>
                </header>
    
                <?php /* The loop */ ?>
                <?php while ( have_posts() ) : the_post(); ?>
                    <?php get_template_part( 'content', get_post_format() ); ?>
                <?php endwhile; ?>
    
                <?php twentythirteen_paging_nav(); ?>
    
            <?php else : ?>
                <?php get_template_part( 'content', 'none' ); ?>
            <?php endif; ?>
    
            </div><!-- #content -->
        </div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: