Support » Fixing WordPress » How to switch to 2-column or 3-column in a theme

Viewing 1 replies (of 1 total)
  • There is no simple “switch” to do this since the column layouts are hardcoded into the template files of the theme. But it can be changed by editing a small piece of code where you want a different setting than the default.

    The standard setup in the WP-Andreas01 theme (as of v2.x) is that all template files (index.php, archive.php, search.php etc.) use the 3-column layout. The one exception is “pages” (page.php) which excludes the third column to make room for more content and a subpage menu if the page has subpages.

    If you want to use the 2-column layout on other places than for content pages, then you can do it by excluding the right-hand sidebar (#extras) from the template files that are used to show your pages, and then changing the div ID “content” into “contentwide”.

    For example, if you want single blog entries to use the 2-column layout, you edit single.php to make sure that the sidebar is not not included, and that the main content div is renamed into “contentwide”. To see how it should look, compare with page.php. If you want archives to use the 2 column layout, you do the same thing in archive.php.

    Just keep in mind that the third column includes the common blog extras such as tag cloud, category list, archive links and a search form by default, and that you may need to use widgets to put the desired sidebar features in the left column which is always visible since it is loaded through the header.php template file.

    If you need help with any detail in these instructions, just make a follow-up post here. Good luck!

Viewing 1 replies (of 1 total)
  • The topic ‘How to switch to 2-column or 3-column in a theme’ is closed to new replies.