How to get header footer and sidebar in wordpress

How to get header footer and sidebar in wordpress

Today I am going to share three mostly used WordPress function about how to load header, footer and sidebar in your WordPress theme. Each WordPress theme contain 3 common files for header(header.php), footer(footer.php) and sidebar(sidebar.php). To load that files WordPress have 3 dedicated functions.

– Load the header:

Header section contains basic elements like logo, top menu, main menu, top advertisement space and breaking news section in WordPress theme. To load header of a theme  we use following function in WordPress. WordPress automatically search header.php file in theme folder. If it found header.php file then it’s include it with theme otherwise it’s load default header.

//this function use to load header.php file in wordpress
get_header();

– Load footer:

Footer section can contains widgets, copyright texts and other basic widgets. To load footer of a theme we use following function in WordPress. WordPress automatically search footer.php file in theme folder. If it found footer.php file then it’s include it with theme otherwise it’s load default footer.

//this function use to load footer.php file in wordpress
get_footer();

– Load sidebar:

Sidebar section contains widgets like search box, categories, tags, recent posts, recent comments and custom widgets. To load sidebar of a theme we use following function in WordPress. WordPress automatically search sidebar.php file in theme folder. If it found sidebar.php file then it’s include it with theme otherwise it’s load default sidebar.

//this function use to load sidebar.php file in wordpress
get_sidebar();

Enjoy.

Was this information useful? What other tips would you like to read about in the future? Share your comments, feedback and experiences with us by commenting below!

Total 0 Votes
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Leave a Comment

Back To Top