search.php I have this code →
<div class="main col"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php get_template_part('content',get_post_format()); ?> <?php endwhile; ?> <?php else: ?> <?php get_template_part('content', 'none'); ?> <?php endif; ?> </div>
Actually, It is pulling content from the content.php, which was mainly built for the index.php. There are so many things that I do not want in my search.php
Let me explain in detail, but before I do that let me show you my live page here, which is a WordPress website.
So basically in my search page result, I do not want these things →
- I also do not want this much amount of text → https://www.screencast.com/t/cG0nj0lcHb
- I also do not want the author box → https://www.screencast.com/t/PXxueQeeVKF5
so what should I do? Do I need to create a separate file other than content.php like this☻→ content-search.php or In content.php I have to put some If___ else___ condition to customize the search result page and at the same time, the index.php shouldn't be affected.