|
How To Add Custom Header, Footer, Sidebar On Different Categories
Posted by Modestas J on 21 June 2012 01:26 PM
|
|
|
Probably we have seen lots of WordPress websites with customized header, footer and sidebar on different categories pages. In this article, we will explain how to make those customizations for our blog or website. Firstly, we will add custom header. Go ahead and open WordPress theme "index.php" file. Then find a line "get_header(); ?>" and replace it with the following lines: get_header('category'); The code above means, if the visitor opens category named "category", then WordPress will execute file "header-category.php". If it doesn't exist, then default header will be displayed. To add custom sidebar to category page, look for the line that says "get_sidebar(); ?>" and replace it with the following lines. { get_sidebar('category'); } If the selected category will be named "category", WordPress will run file "sidebar-category.php". Finally, custom footer can be added by replacing line "get_footer(); ?>" with the lines below. { get_footer('category'); } Remember to replace word "category" with chosen category name. | |
|
|
|

