Site logo

[Resolved] Search results as a list

Home Forums Support [Resolved] Search results as a list

Home Forums Support Search results as a list

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2097461
    Francesco

    Hi,

    I’ve searched the forum but haven’t found anything.

    I would like to have the search results as a list.
    No columns. No images, no dates, just a list of titles and extracts.

    Many thanks.

    #2097483
    Ying
    Staff
    Customer Support

    Hi there,

    You can use a block element – content template and assign it to the search result page.

    And use this PHP snippet to turn off the columns on search result page:

    add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' );
    function lh_custom_search_results_page_settings( $options ) {
        if ( is_search() ) {
    	$options['column_layout'] = false;
        }
      
        return $options;
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #2099329
    Francesco

    Hi Ying,

    many thanks for your answer.

    I have also added

    $options[‘date’] = false;
    $options[‘author’]= false;

    What should I write to prevent the featured image from being displayed?

    Many thanks.

    #2099374
    Leo
    Staff
    Customer Support
    #2099723
    Francesco

    Got it. Many thanks.

    #2100416
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.