Different headers and footers using the $name argument

Both the_header and the_footer functions except a $name argument which allows you to specify other headers than the default header.php and footer.php.

Example:

<?php get_header( 'special' ); ?>

WordPress would then look for header-special.php in your theme directory. If you want to specify a different footer file it works the same way.

I rarely see it used but it can be quite useful, perhaps if you want a “clean” header with just the <html> and <head>.

Read more in the WordPress Codex:
get_header
get_footer 

Advertisements
About

Web Developer @ Oakwood Creative - www.oakwood.se

Tagged with: , ,
Posted in Beginner

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

About

WordPress Quick Tips is a blog supplying great tips about WordPress.

We hope to create a great knowledge resource for WordPress developers as well as serving a reminder for all the forgetful ones.

The blog is created and run by Vincent of Oakwood Creative

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 120 other followers

%d bloggers like this: