MEET SITKA | A super-customizable modern WP theme!

Okay
  Print

Automatically set all of Oleander's post pages to be full-width

Please note: This article is specifically for the "Oleander" theme. 



Oleander lets you choose your singular post page's layout on a post-by-post basis. This means you could have one post be full-width and one post with a sidebar. By default, your posts will be set to display a sidebar. 
You can adjust the layout of each post via the "Post Layout" drop-down menu within a post's create/edit screen. 

If you have lots of posts which are now displaying a sidebar and you'd like them all to be full-width instead, it can be very time-consuming to go into each post and manually change its layout. 
If you would like to automatically apply the full-width post layout to all of your posts, past and future, you can follow the steps below. 

Navigate to Appearance > Editor > and open up the file titled "single.php". 
On Line 11 of this document, you'll see this line of code:

<div id="main" <?php if($single_template == 'full-post') : ?>class="fullwidth"<?php endif; ?>>


You can replace that code with the following instead:

<div id="main" class="fullwidth">


Be sure to save changes when finished in this file. 
If you have a cache tool running on your WordPress, you may need to clear the cache afterward.

This will make all of your singular post pages be full-width automatically. 
If you ever decide you want to re-enable your ability to change a post's layout (within the post's create/edit screen), you can go back into this "single.php" file and follow these instructions backwards.