I have been using the Twenty Eleven Theme for WordPress as a basic, no-frills design that gets my blog working with the minimum of fuss. Unfortunately, the Single Post (single.php) template in its unmodified form used a very basic design with just one column and no sidebar. This left a lot of unused and valuable real estate on the screen and most importantly meant that I couldn’t include skyscraper ads.
Instead of a single column design, I wanted something like this:
Instructions to add a sidebar to single posts and pages (2011 WP theme)
Open the theme editor (Appearance > Editor) and edit Single Post (single.php).
Find this code:
<?php get_footer(); ?>
And add this just above:
<?php get_sidebar(); ?>
Edit styles.css and paste the following text at the end of the stylesheet:
/*** add sidebar to single post ***/
.singular #primary {
margin: 0 -26.4% 0 0;
}
#nav-single {
display: none;
}
.singular .entry-header .entry-meta {
position: relative;
}
.singular .hentry {
padding: 0;
}
.singular .entry-header, .singular .entry-content, .singular footer.entry-meta, .singular #comments-title {
width: 100%;
}
.singular #content, .left-sidebar.singular #content {
margin: 0 34% 0 7.6%;
}
.singular article .entry-title {
padding-top: 0;
}
.singular .entry-meta .edit-link a {
right: 0;
top: 0;
left: auto;
}
Make sure you save the changes and then view a single post to check if it works.
