top of page

Wide Posts in WordPress

Nov 20, 2005
1 min read

I’ve added a hack which enables me to choose whether or not to have that sidebar on the right on a post by post basis. The benefit is that the posts Carnivalesque and Black Knight display properly. Dull technostuff below the fold. The system uses the custom fields feature. I set up a field called formatquack (named to avoid clashing with any likely future names for a field) and for entries which I wanted to have the sidebar omitted put in the value “single”. I then modified the header to read:

<?phpthe_post();if(get_post_custom_values('formatquack')) {echo " <link href=\"http://archaeoastronomy.co.uk/wp-content/themes/regulus_wordpress_theme/style-single.css\" type=\"text/css\" rel=\"stylesheet\" />";}else{echo " <link href=\"http://archaeoastronomy.co.uk/wp-content/themes/regulus_wordpress_theme/style.css\" type=\"text/css\" rel=\"stylesheet\" />";}rewind_posts();?>

Now if anything is in the formatquack field it will call up the style-single stylesheet. This is identical to the usual sheet except that sidebar is set to display:none; and the content column is set to be wider. —–

 
 
 

Recent Posts

See All

Comments


bottom of page