fbpx
11 C
Lahore

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

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