Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #617932

    MrK
    Participant
    This reply has been marked as private.
    #617938

    MrK
    Participant

    your layout for search result is this: http://theme.co/x/demo/integrity/1/?s=pl

    #618040

    Paul R
    Moderator

    Hi,

    As stated above masonry layout is not available for search results page. It could be possible to achieve with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

    https://community.theme.co/forums/topic/search-and-filter-plugin-integration-with-search-loop/#post-614645

    Thank you for understanding. Take care!

    #618047

    MrK
    Participant

    Sure guys what I meant was: if I want to change the search results layout which is the file I have to edit?

    the _index.php you pointed me too?

    #618128

    Jack
    Keymaster

    Hi there @mrk,

    That’s correct, if you want to edit the search results layout, you’ll need to edit the _index.php we pointed you too, and you’ll need to use some custom css. 🙂

    Thank you!

    #618138

    MrK
    Participant

    But somehow it seems that anything I add on that page (let’s say I create a div to show TEXT) just has effect on the archive layout page but not on the result one?

    I copied this file wp-content/themes/x/framework/views/global/_index.php into here wp-content/themes/x-child/framework/views/global/

    If I did correct I’ll check then

    #618173

    MrK
    Participant

    usually the page is search.php

    #618232

    Zeshan
    Member

    Hi there,

    X utilizes index.php template file for all pages including archives. There is no other template file, e.g. search.php. But you can always create one if you wish to achieve a different layout.

    Making changes to _index.php directly will eventually show up on all the archive pages due to the reason it’s being used by all of them. In this case, you could either create a separate search.php template file in the root of your child theme, or use WordPress Conditional Tag for search results page to make the changes specific to the search results page.

    As this would be a custom development, regretfully it would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

    Thanks for understanding. Take care!

    #618240

    MrK
    Participant

    Hi thanks sorry maybe I didn’t explain well but yes _index.php shows archives but I need the page that shows the search results.

    If you make a search on your theme here: http://theme.co/x/demo/integrity/1/shortcodes/accordion/
    TOP RIGHT search on the NAVBAR menu

    you get to a page with just one column
    While your archive page is different.

    hope I explained better

    #618417

    Jade
    Moderator

    Hi there,

    Thanks for explaining further. Although the archive and search result page displays with different layout, they utilize one file which is _index.php. There are few lines in the code that checks if the user is the search page and it gives the page a one column layout. You can try to scrutinize the codes in the file further if you have some development skills. This is actually a little more complex to implement and requires a little more customization that unfortunately falls beyond out scope. But it might help if you check on how to implement masonry layout through custom javascript/CSS. You may get some ideas here. The search results page has a class .search-results so you can use it to reference specifically the search results page.

    Hope this gives your more idea.

    #618419

    MrK
    Participant

    Thanks is exactly what I was looking for. Yes the isotope container is loaded just on archives using the _index.php page.

    thanks guys

    #618434

    MrK
    Participant

    Hope that might help someone else if needed this is correct code that worked. Now search results is styled like archive.

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

    thanks

    #618802

    Rad
    Moderator

    Nice, thanks for sharing 🙂