How to Center the Twenty Fourteen Theme (and/or Remove the Left Sidebar)

Share This:

The Twenty Fourteen is the default WordPress theme at the time I’m writing this post – which means when you install WordPress it’s the theme that’s automatically on your site.

By default it looks like this:

default Twenty Fourteen theme

default Twenty Fourteen theme

Hmmm you may say…but wait, it really is a nice theme, in fact, I really like it, it’s become my favorite default WordPress theme.

But I’m not too crazy about how it looks right out of the box; the left alignment I especially don’t care for.

But, like most WP default themes, it’s highly customizable. When it first came out, I was using the Fourteen Extended plugin to align the 2014 to the center, along with removing the left sidebar (if I wanted to) and a few other things.

But just recently,the Fourteen Extended became unavailable–from what it says on the plugin author’s site, he got sick and has been unable to keep it up to date, so POOF!, it disappeared from the WordPress.org plugin repository.

What happened to the Fourteen Extended plugin

Where is the Fourteen Extended plugin?

It probably, maybe, will be updated when he gets better, but I’ve decided from these happenings that I don’t like relying on a plugin for site layouts, etc.

If you use Fourteen Extended plugin to center your Twenty Fourteen site, perhaps also remove the left sidebar, and the guy gets another hay fever attack, well, not good 🙂 (all the best to the plugin author though, not blaming him, stuff happens)

So, here’s a video tutorial on how to center the Twenty Fourteen theme without using the Fourteen Extended plugin, and another on how to remove the left sidebar.

It’s easy guys and gals, just watch the videos below, and then copy the code below the videos.

<?php
	// Removing left sidebar of Twenty Fourteen
function remove_left_sidebar(){
	unregister_sidebar( 'sidebar-1' );
}
add_action( 'widgets_init', 'remove_left_sidebar', 11 );
?>

Note: Any code in this file needs to be before the closing ?> tag.

Here’s the code you put in your Twenty Fourteen child theme’s style.css file. If you just want to center your 2014 site and keep the left sidebar, just use .site code below this code. 🙂

@media screen and (min-width: 783px) {
	 .primary-navigation {
		 float: right;
		 margin-left: 20px;
	        }
}
.site {
		margin: 0 auto;
		}
		media screen and (min-width: 1110px) {
	.archive-header,
	.comments-area,
	.image-navigation,
	.page-header,
	.page-content,
	.post-navigation,
	.site-content .entry-header,
	.site-content .entry-content,
	.site-content .entry-summary,
	.site-content footer.entry-meta {
		padding-left: 55px;
	        }
	            }
	        .site-content .entry-header,
.site-content .entry-content,
.site-content .entry-summary,
.site-content .entry-meta,
.page-content {
		max-width: 874px;
        }
        
        .comments-area {
		max-width: 874px;
        }
        
        .post-navigation, .image-navigation {
		max-width: 874px;
        }
        
        .site:before,
#secondary {
		width: 0;
		display: none;
	    }

.featured-content {
		padding-left: 0;
        }
        
        .site-content, .site-main .widecolumn {
		margin-left: 0;
        }  
        
        .hentry {
		max-width: 900px;
        }
.post-thumbnail img {
		width: 100%;
		}  
	    

Code for centering site only:

.site {
		margin: 0 auto;
		}
MIKE SIMMONS (10 Posts)

Mike Simmons has a real passion for online "stuff", is an avid WordPress fan and user, really gets into designing, developing, and optimizing websites, and gets great satisfaction out of helping others to get started online by creating their own websites with WP...and more -- so in his spare time, he's busy creating WP tutorial videos for his YouTube channel(s) and more free content to share on WPHow2s. For more great info follow, like, and subscribe on Mike's social hangouts. Keep on keepin' on!


About the Author

Mike Simmons has a real passion for online "stuff", is an avid WordPress fan and user, really gets into designing, developing, and optimizing websites, and gets great satisfaction out of helping others to get started online by creating their own websites with WP...and more -- so in his spare time, he's busy creating WP tutorial videos for his YouTube channel(s) and more free content to share on WPHow2s. For more great info follow, like, and subscribe on Mike's social hangouts. Keep on keepin' on!

Leave a Reply 0 comments

Leave a Reply: