fbpx
33 C
Lahore

WordPress: How to auto include header and footer for every template in wordpress?

Must read

Ayyaz Zafarhttps://www.ayyaztech.com
I am Full Stack Web Developer with 10 years of professional Experience. I have following Skills: HTML5, CSS3, Javascript, jQuery, Ajax, PHP, MySQL, jQuery, Angular, React.js, Wordpress, Codeigniter, Laravel, Node.js, Mongo DB, Express.js, GraphQL, Typescript, Apollo and many more..

Put following code in functions.php to enable auto header, footer include in every custom template you will create.

add_filter( 'template_include', function( $template ) {

    get_header();
    include $template;
    get_footer();

    return FALSE;
});

 

- Advertisement -spot_img

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article