Add a sidebar to Storefronts Gridport Theme main Blog page

Posted by on Mar 14, 2012 in Gridport, Storefront Themes, Wordpress | No Comments

Yet another request for little modifications and additions for the Storefront Themes Gridport theme. This is number six. This is becoming a blog about one theme!

The question

“Can I have a sidebar on the main Blog page?”

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.

If you have a standard Gridport setup you have Settings/Reading set to static page with the page “Blog” set to be your Posts page. With this arrangement, although you assign a page to hold your Blog, WordPress uses index.php.

Locate the index.php file which is in Gridport theme folder. Make a safe copy somewhere in case you have problems.
The last few lines of that file starting at approximately line 94, it may vary with version, are 3 lines of code and some empty lines between. You just add the one highlighted line of code right before the closing of the grid-content div as shown below.

  <?php endif; ?>

<?php get_sidebar(); ?>
	</div><!-- grid-content -->
	
<?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