Search Results in Grid Format in Genesis

How to Show Search Results in Grid Format in Genesis

Showing posts in grid format is a good idea because it improves the visibility and aesthetic appeal of your blog posts, archives and related posts.

When it comes to using grid format in Genesis, most of us usually use it to on our blog archives or related posts. This can be done by either using a plugin or modifying your functions file.

However, if you want to show search results in grid format, you will need to follow a whole new approach.

In this guide, let’s talk about how to show search results in grid format.

Essentially, we will follow three steps to complete this task:

Step #1: Create a Custom Loop

Create a new file within your active theme and name it “search.php” and then copy and paste the following code.

https://gist.github.com/topleague/1860988bdf7ace631dfb1ea0d99fb0cd

Step #2: Show Search Results in Grid Format

Add the following code to your functions file. The code shows three columns by default but if you want to increase or decrease the number of columns, you need to make necessary adjustment in the code.

https://gist.github.com/topleague/8168f1c3d84771b4a9d53d1e16de419e

Step #3: Customize Your Look

Finally, you need to customize the appearance of your grid columns by tweaking the stylesheet. For the sake of this guide, I added the following code.

.search .site-inner {
max-width: 100%;
}

.search .entry {
margin-bottom: 0;
padding: 30px;
padding-bottom: 0;
}

.search .entry-title {
font-size: 29px;
font-size: 2.9rem;
}

That’s it! Let me know if you have any questions.


Comments

4 responses to “How to Show Search Results in Grid Format in Genesis”

  1. Hello dear, I tried to modify search results of my website ssznotes.com using the instructions you provided above. However, nothing happened. I am using the Magazine pro child theme and Genesis parent theme. I also installed genesis root plugin but it didn’t work. I think the parent theme isn’t recognizing the changes made in the child theme search.php.

    Please guide

  2. adewale mayowa segun

    You are doing great. I was lucky to see this post at the right time. Thanks

  3. I just implemented this and it works great, thank you! Is it possible to display featured images for the search results?

  4. Thanks so much for this. I’ve been wanting to customize my search results page and this worked great. However, the pagination doesn’t work, and what about when NO results are found. My result page on that was totally blank.

    Again, thanks so much! I really appreciate it.
    Pamela