• Hi,

    I’ve just created a new page template, starting from the default code in page.php. What I want to do is remove the footer and header for the new template, while keeping all the other properties of the default template. How can I do this?

    When I remove

    <?php get_footer(); ?>

    form the new template, the footer disappears, which is okay.

    But when I remove

    <?php get_header();
    	get_template_part('templates/page', 'header'); ?>

    all the styling disappears. Plus I’m left with a padding all around the page and the page name is gone too. How can I remove the header and the padding while keeping the old styling?

    Thanks!

Viewing 1 replies (of 1 total)
  • look into what ‘get_header()’ actually calls by calling header.php;

    either:
    add the essential code to the start of your page template;
    or:
    create and call a custom header file; for example, get_header('extra') will call a file header-extra.php.

    same with the footer … just not calling it will fail some plugins etc as the footer also contains some essential codes, and the closing body and html tags.

Viewing 1 replies (of 1 total)
  • The topic ‘Style new page template’ is closed to new replies.