Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1004138
    mpanesar
    Participant

    Hi all,

    I wanted to configure the way that x-theme displays the search results, at present it is shown with a very bad layout compared to the blog and archive pages. My main is to replicate the blog or archive layout with the search results:

    I have modified the _index.php under x-child theme however no changes have been seen:

    $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      = x_get_option( 'x_archive_masonry_columns' );
      $condition = is_archive() && $style == 'masonry';
    endif;
    
    ?>

    Any guidance or feedback would be greatly appreciated 🙂

    #1004493
    Lely
    Moderator

    Hello There,

    Please try this code instead:

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_INDEX.PHP
    // -----------------------------------------------------------------------------
    // Includes the index output.
    // =============================================================================
    
    $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() ) :
      $cols      = x_get_option( 'x_archive_masonry_columns' );
      $condition = true;
    endif;
    
    ?>

    Hope this helps.

    #1006010
    mpanesar
    Participant

    Excellent – thanks!!

    #1006041
    Rahul
    Moderator

    You’re most welcome!

  • <script> jQuery(function($){ $("#no-reply-1004138 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>