Home > Net >  Is there a way to call the header and footer only once without calling it in each templates
Is there a way to call the header and footer only once without calling it in each templates

Time:03-23

I am looking for a way to call the header and the footer separately from custom templates

Right now I have to call them like this :

<?php /* Template Name: Page Home */ ?>

<?php get_header(); ?>

<div>
 my page
</div>

<?php get_footer(); ?>

But I want to find a way to call those elsewhere and only once so that I don't have to call them again in custom templates.

CodePudding user response:

I don't know wordpress, but if you can create view templates, you can create a base template with the footer and the header and then call this file in the controllers.

  • Related