Home>Support>Using a custom landing page template without any header breaks Pagebuilder

Using a custom landing page template without any header breaks Pagebuilder

I’m trying to add landing pages to a site that is using the Prophoto theme. This is a quite sophisticated theme that does everything in its own peculiar ways, so I suspect that is the root of my problem, but I want to ask in case I’m doing something obviously wrong.

When I installed Pagebuilder and the Widget bundle and downloaded the Mono “site pack” into a test page using the default page template, it worked as expected.

But my standard pages have headers and footers that I don’t want on landing pages, so I created a child theme and a custom landing page template without getheader and getfooter, and now the content doesn’t display right.

Is there some reason why removing the calls to getheader and getfooter from the page template would cause the main content not to display normally?

First I tried modifying Prophoto’s default template, but the code looked peculiar, and after editing out getheader and getfooter, it didn’t work. Then I found a very standard page template and edited it down, and this is my full and complete custom template:

<?php
if (have_posts()) while (have_posts()) : the_post();
the_title('’, ”);
the_content();
endwhile;
?>

You can see the failed test page running my custom template here: https://sosnovska.com/test/
And you can see another test page running Prophoto’s default template with Pagebuilder content looking fine but unwanted header and footer here: https://sosnovska.com/test2/

Both pages have as their content the Mono “site pack” and nothing else.

If anyone can help figure out why the custom template makes Pagebuilder content not work I’d be very grateful.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 2 months ago warnerta

    I solved this problem with a better “clean page” template, which I found here: https://www.wonderplugin.com/wordpress-tutorials/how-to-create-a-wordpress-page-without-header-menu-sidebar-and-footer/

    It seems I don’t need getheader or getfooter, but I did need some other code at the top.

    Also, my bad, I didn’t mark the code properly in my question. Here is the template I used that didn’t work.

    <?php
    /*
     * Template Name: Landing Page
     * Description: Page template with no footer or header or sidebar
     */
    ?>
    <div id="landing-page-wrapper">
    <?php
        if (have_posts()) while (have_posts()) : the_post();
            the_title('<h1>', '</h1>');
            the_content();
        endwhile;
    ?>
    </div>
    

    Also to clarify what I used was the Mono page design as downloaded from inside Pagebuilder.

  2. 7 years, 2 months ago Alex S
    Hi, I Work Here

    Hi Warnerta,

    I’m glad you were able to resolve this issue. I’m sorry I wasn’t able to be of assistance this time. Please be sure to post another thread if you have any other questions.

    To clarify, the key line required in the template you used is wp_head() and wp_footer(). Without either of those lines present in the tmeplate we (and other plugins) aren’t able to reliabily add styling or JavaScript to the page which results in an incomplate (read: broken) page.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More