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;
});

 

About admin

Check Also

Best resources to learn Angular2+

https://codecraft.tv/courses/angular/

Leave a Reply

Your email address will not be published. Required fields are marked *