Genesis Search Results Template You Can Fully Customize

This template for Genesis, enables you to customize how the search results are displayed on the search results page. The template includes settings in the code which you can easily modify to fully customize the output on the frontend so its different to the standard search results.

The template enables you to:

  • Set the layout
  • Show or remove the featured image
  • Set the featured image size using any default WordPress > Media or added custom image sizes
  • Align the featured image left, right, center or none
  • Display the full content, set content character limit or display the excerpts
  • Customize the read more link for each entry
  • Set posts per page for each result

Template Installation

  • Upload the search.php template to your child theme folder.
  • Add the Optional Code below to your child themes functions.php file.

Here’s the template and code for logged in members:

Related Tutorials


Comments

10 responses to “Genesis Search Results Template You Can Fully Customize”

  1. Elizabeth DellaSelva-Martinez Avatar
    Elizabeth DellaSelva-Martinez

    Ok, I copied this code to my search.php file and added the code to the functions.php file – and I am still getting an excerpt for the search results page when I want the full content. When I activate an alternate genesis child theme and use that search.php file I get the full content displayed. So, I know it has something to do with the child theme that I am using – I completely deleted the archive.php file in case there was something in the archive.php file that was over riding the settings from the search.php file – still no luck.

    So, I’m guessing there is something in the functions.php file, but I am completely baffled because nothing fits or makes sense.

    Any other tips?

    1. Please send me a copy of your child theme so i can look in functions.php

  2. Chris Connaker Avatar
    Chris Connaker

    Hi Brad – I’m using this code to show a search form at the bottom of my search result page, but the search for is covering up the pagination buttons. Any idea how to fix this?

    Here is the code I have at the very bottom of my search.php. removing the search form code, enables my pagination to show just fine.
    [code]
    add_action( ‘genesis_after_loop’, ‘custom_display_search_form’ );
    function custom_display_search_form() {
    echo get_search_form();
    }

    //* Run the Genesis loop
    genesis();
    [/code]

    1. Brad Dalton Avatar
      Brad Dalton

      Hi Chris

      You can change the hook genesis_after_loop to any other hook

  3. Chris Connaker Avatar
    Chris Connaker

    OK, I figured it out that I needed the word “excerpts” rather than “excerpt.”

    Now my question is, how can I add a “read more” link and limit the length of the excerpt shown on the search page? I have it working when I display content using the code above, but when I want to just show excerpts, the read more link doesn’t appear and the excerpts are too long.

    1. Brad Dalton Avatar
      Brad Dalton

      You can use the content limit with a read more link or limit the excerpts and add a read more link.

      Try these code snippets

      1. Chris Connaker Avatar
        Chris Connaker

        HI Brad – I tried the code snippets, but still no luck displaying Read More link or changing the excerpt length, unless I’m viewing Content rather than the excerpt.

        This is a custom / manual excerpt in the posts (if this matters).

        1. Brad Dalton Avatar
          Brad Dalton

          You’ll need custom code for that unless it has already been published somewhere. So you have chosen excerpts and now want to limit it as well as add a read more link? Try this code https://wpsites.net/wordpress-tips/add-custom-read-more-link-to-excerpts/

  4. Chris Connaker Avatar
    Chris Connaker

    Hi Brad – I’m trying to show excerpts on search results. Do I just need to change

    “return ‘content’;” to “return ‘excerpt’;” ?

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.