[wp-hackers] Post/Page "Types"?

Peter Westwood peter.westwood at ftwr.co.uk
Sun Nov 30 18:25:26 GMT 2008


Bernard D. Tremblay (ben) wrote:
> Fine thought ... spot on ...
> ... cept (and I just went through a stack of Codex docs) I find no way 
> of doing what you made seem so simple here.
>
> To use your words: How do I "load different header.php files depending 
> on the type of page/post/category being displayed?"
> Simpler: can it be done?
>
Requires 2.7 but the following will work.

in the page/post/category templates replace the following calls:

get_header() / get_footer()

With

get_header('page') / get_footer('page')

And add header-page.php and footer-page.php to your theme

See this for more info:
http://phpdoc.ftwr.co.uk/wordpress/WordPress/Template/_wp-includes---general-template.php.html#functionget_header

westi
-- 
Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5 



More information about the wp-hackers mailing list