Add a sidebar to the Storefront Gridport Theme Search results page.

Well there seem to be lots of requests for little modifications and additions for the Storefront Themes Gridport theme. This is number four and I have one more to write..

The question

“Can I have a sidebar on the search results page as it looks a bit empty full width?”

The answer is yes. You will need to do one extremely simple PHP edit. I don’t think it could be any easier than this one. If you have not done this before see the note “Tools” at the bottom of this post. In this case it is so simple you could do it by going to Appearance/Editor in the WordPress backend and opening and editing it there.

Locate the search.php file which is in Gridport theme folder. Make a safe copy somewhere in case you have problems.
The last 5 lines of that file starting at approximately line 124, it may vary with version, are 3 lines of code and 2 empty lines between. You just add the one highlighted line of code below to the first of the empty lines as shown below.

  </div><!-- end of left content -->
<?php get_sidebar(); ?>
<div class="clear"></div>

<?php get_footer(); ?>

Tools:

You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.
If you do not have one, 2 excellent free ones are…
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/
Notepad++ for the PC http://notepad-plus-plus.org/

Leave a Reply