• Resolved Arun Kumar

    (@arunmca)


    Hi Friends,
    I want to know…How to create a inner page template for my search page with left side bar…?… please guide me…. Thank you to all

Viewing 2 replies - 1 through 2 (of 2 total)
  • just create a file in you template directory called

    search.php

    it will be used to display search results automatically (as page.php is used to display static pages or single.php is used to display single posts)

    It’s a regular page, you can use all includes and css calls and stuff, like in any other… It’s basic anathomy is…

    <?php if (have_posts()) : ?>
    
      <h2>Search results to "<?php echo wp_specialchars($s); ?>" </h2>
    
      <?php while (have_posts()) : the_post(); ?>
    
        <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" >
          <?php the_title(); ?>
        </a>
    
      <?php endwhile; ?>
    
      <?php else : ?>
    
        <h2>No results</h2>
        <p>"<?php echo wp_specialchars($s); ?>" returns no results</p>
    
      <?php endif; ?>

    This is the basic, you should include your header, footer, sidebar, divs, grid tempale or whatever you need, it totally works as a regular page o loop.

    I hope it be usefull to you 🙂

    Thread Starter Arun Kumar

    (@arunmca)

    Thank you So Much for brief explain…. it’s helpful for me….

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to create a inner page template for my search page with left side bar…?’ is closed to new replies.