Kelvin Farrell
Kelvin Farrell

Reputation: 305

Define 'Default Template' for each section

Is it possible to define a different 'Default Template' for each parent section on a website? On each page I have 3 images in the sidebar. I want these 3 images to change depending on what section the user is viewing.

How would I achieve this?

Upvotes: 1

Views: 53

Answers (2)

eddiemoya
eddiemoya

Reputation: 7478

You can define a completely custom Template Hierarchy by filtering 'template_redirect'.

http://phpxref.com/xref/wordpress/wp-includes/template-loader.php.source.html

Upvotes: 0

Naftali
Naftali

Reputation: 146302

With the power of learning!

You can make a template to fit in all of the options that you want on each page.

Something like an MVC might fit your needs as it seperates the templates from the backend code.

Upvotes: 2

Related Questions