Search Page Layout

Hello,

I’m trying to create a custom Search Page. And I’m currently using the code below to display the search results. It’s working ok, I mean it displays the results in masonry layout, outputs the search term and the number of results. But what I’m actually trying to achieve is a 2 column layout with equal heights columns, the featured image first, title second, author and category. Could you help me out with this? The code is pasted in a _index.php file located in the child theme directory.
Here is the search page: https://new.cutra.ro/?s=carolina

      $stack = x_get_stack();

if ( is_home() ) :
  $style     = x_get_option( 'x_blog_style' );
  $cols      = x_get_option( 'x_blog_masonry_columns' );
  $condition = is_home() && $style == 'masonry';
elseif ( is_archive() ) :
  $style     = x_get_option( 'x_archive_style' );
  $cols      = x_get_option( 'x_archive_masonry_columns' );
  $condition = is_archive() && $style == 'masonry';
elseif ( is_search() ) :
  $style     = x_get_option( 'x_archive_style' );
  $cols      = 2;
  $condition = is_search();
endif;

?>

<?php if ( $condition ) : ?>

  <?php x_get_view( 'global', '_script', 'isotope-index' ); ?>

  <div id="x-iso-container" class="search-container x-iso-container x-iso-container-posts cols-<?php echo $cols; ?>">

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

  </div>

<?php else : ?>

  <?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 endif; ?>

<?php pagenavi(); ?>

Hi @robertblaj,

Thanks for reaching out.
It seems that you are trying to do with the custom coding, which is beyond the scope of our Theme Support. As you are using the Pro, I would suggest you use the Layout Builder and create a custom Archive Layout and assign it to the Search Result page.


Please remember that we don’t offer any support and investigation on custom code and related issues. If you still need help on this, I would suggest you avail of our newly launched service called One, where we answer questions beyond normal theme support.

Thanks