I am developing a WordPress template (or rather trying to) and need a bit of help/advice.
I have a template that consists of a header (inc nav), footer, main content area.
The main content area has two columns – the left column for a sub-menu and the right for content, as demonstrated by the crude diagram linked below. The right content area contains several more rows and columns which are different for most pages of the site – some have a series of rows and columns, others have a single row/column.
I’m wondering what the best way to create these templates are – do I create several templates, each accommodating the different structure or is there a better way? The only thing that is inconsistent between each page is the right hand column (purple area), and it seems a shame to duplicate the entire page into a new template just because of this one inconsistent area, especially more so if I have different styles within the content area.
I’ve added a screenshot to demonstrate two possible layouts!
Edit: I don’t have the required 10 reputation to post images unfortunately, so image is located here:
Your consistent/common areas are:
So you can easily make them accordingly to:
get_header();
get_footer();
get_sidebar();
And the right content area, as it is inconsistent, so it can be separated into a different page as:
And to include them just put the following code accordingly:
In this way you can part your template into various particles and can include them where necessary. Any question is highly recommended with thanks. 🙂