How to customize the search page?

Hello. I am wondering how to customize the look of my search results page. Currently, when I search in my site I get a list of everything related (the entire product description and/ or blog post) with a huge image, like this; https://equineoutfitters.biz/?s=supplements

How can I get the search results to display in a neat list with just the product or blog post and a small picture?

Hi There,

That will need template customization. I will guide you on the template structure but how it looks and the complete code is outside the scope of our support. The template responsible for search is this:
\wp-content\themes\x\framework\views\renew\wp-index.php
Copy that file on the same path on your child theme here:
\wp-content\themes\x-child\framework\views\renew\wp-index.php
Open the copied file and then look for this line of code:
<?php x_get_view( 'global', '_index' ); ?>
Replace that with this:

      <?php if(is_search()){
      	
        x_get_view( 'global', '_search' ); 
      }else{
      	x_get_view( 'global', '_index' ); 
      } ?>

That code says that instead of using wp-content\themes\x\framework\views\global\_index.php it will now use _search.php. Create the file _search.php on your child theme here: \wp-content\themes\x-child\framework\views\global\_search.php
Add the following code on this _search.php file:

<?php

// =============================================================================
// VIEWS/GLOBAL/_SEARCH.PHP
// -----------------------------------------------------------------------------
// Includes the index output.
// =============================================================================

$stack = x_get_stack();

?>

  <?php if ( have_posts() ) : ?>
    <?php while ( have_posts() ) : the_post(); ?>
      <?php  x_get_view( $stack, 'content', get_post_format() ); ?>
    <?php endwhile; ?>
  <?php else : ?>
    <?php x_get_view( 'global', '_content-none' ); ?>
  <?php endif; ?>

<?php pagenavi(); ?>

Edit the content of this _search.php as you wish to display. That is the template structure. Unfortunately, more customization from here would be getting into custom development which is outside the scope of our support. Thank you for understanding.

I did these steps but it looks exactly the same. I don’t know php so I suppose I need to hire someone? Do you offer custom development?

Hello @jessparvin,

Thanks for updating thread. :slight_smile:

We used to provide custom development service but as of now we have stopped taking that up as our custom development team is focusing more towards Enterprise Clients.

However, you have post your query in Facebook group that managed my community members. I am sharing the link. Please note that this group is was not created, managed and sponsored by Themeco.

https://www.facebook.com/groups/xthemeusers/

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.