Skip to content
Advertisement

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

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.

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement