Custom Post Templates
-
I have a 3-column theme, which I would like to add a customized 2-col post template for posts. I have tried CSS, etc., but cannot seem to get it to work.
Should I remove the left sidebar in single.php, the right sidebar shifts, but no CSS content adjustments work.
Below is the site and the files…thank you in advance for any input.
Site example: http://9001sites.com/test/
Files:
functions.php: http://pastebin.com/fqVfa2c2
single.php: http://pastebin.com/p8DMgf8f
sidebar-right: http://pastebin.com/Zfp6hpRw
-
Here are some tips to get you started:
- Make a copy of single.php. Call it twocolumn.php.
- Insert the ‘Template Name: twocolumn’ comment to make it into a template.
- Remove the line that gets the left sidebar:
<?php get_sidebars('left'); ?> - Change screen.css to modify the widths of various classes. There may be a lot of places to change – I probably didn’t find them all. Start by changing line 111 from
.span-14 {width:550px;}to.span-14 {width:740px;}. You may find other places that must be changed. - In style.css at line 24, the background is set for div id=#contentwrap as the image at images/contentwrap-background.png. That image has the two vertical dashed lines in it. You will need to change the div id in twocolumn.php to something else, set up CSS for it, and create a new background image for it.
Hope that takes care of most of it.
@vtxyzzy thank you…I had not considered modifying screen.css.
That got me closer, though the modification seems to now push the right sidebar beyond the 950 width, and therefore wraps it after the post. Decreasing span-14 width don’t work.
See the test post: http://9001sites.com/test/?p=65
-Scott
You need to add a float: left; to your span-14-single. You should look for all the places there is a span-14 and add a span-14-single to the list.
That was it, thank you!
The topic ‘Custom Post Templates’ is closed to new replies.