I'm using WP for a business site (not a blog) with landing pages. So there are no posts, only pages (actually, "landing pages") which I create with the Elementor page builder.
Since a typical theme has lots of unnecessary stuff for a landing page business site, I decided to create a lightweiht custom theme. I have a header.php
, footer.php
and basic css/js enqueued via functions.php
. I want to create each page's content using a page builder.
I don't know what to put in index.php
. This is something typical:
<?php get_header(); ?>
// ....the wp loop goes here
<?php get_footer(); ?>
Of course in my case there is no loop - but that is where the main content goes. When I create a new page with Elementor (or other page builder, or Gutenberg), I want my custom per-page content to go in there, where the loop usually goes.
What markup do I place there, so the page builder knows where to insert each page's content?
I'm using WP for a business site (not a blog) with landing pages. So there are no posts, only pages (actually, "landing pages") which I create with the Elementor page builder.
Since a typical theme has lots of unnecessary stuff for a landing page business site, I decided to create a lightweiht custom theme. I have a header.php
, footer.php
and basic css/js enqueued via functions.php
. I want to create each page's content using a page builder.
I don't know what to put in index.php
. This is something typical:
<?php get_header(); ?>
// ....the wp loop goes here
<?php get_footer(); ?>
Of course in my case there is no loop - but that is where the main content goes. When I create a new page with Elementor (or other page builder, or Gutenberg), I want my custom per-page content to go in there, where the loop usually goes.
What markup do I place there, so the page builder knows where to insert each page's content?
Share Improve this question asked Dec 7, 2019 at 12:18 lonixlonix 3011 silver badge10 bronze badges1 Answer
Reset to default 2in your theme folder. create a new php file.
For example call it: landingpage.php
in the php file you could have something as basic as:
<?php
/*
Template Name: Landing Page
*/
get_header();
while ( have_posts() ) : the_post();
the_content();
endwhile;
get_footer();
?>
Elementor will be called / inserted where it says the_content();
Included out of the box with elementor you should have a blank elementor template to choose from and using the built in elementor theme builder options create exactly what you are after also choosing conditions of when that page template gets used?