最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

theme development - Template for landing pages

programmeradmin4浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 2

in 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?

发布评论

评论列表(0)

  1. 暂无评论