简体   繁体   中英

Must a WP landing page be in HTML or PHP?

I've been asked to create a landing page for a client's WP site. I don't have much experience with WP and wondering if the page should be an HTML or PHP file? I have a CSS and JS file too. Any advice would greatly be appreciated.

Take a look at the WordPress Codex on how to make custom themes . You could edit an existing theme although this isn't advised as you'll lose your changes when you update it.

The landing page must be saved as a PHP file. WordPress will automatically include the right file depending on the page that is requested. The most straightforward way to do this is create a file called template-landing-page.php and on the very first line of the file, paste this in:

<?php /* Template Name: Landing Page */ ?>

Then add your landing page content into that file. When you're done, go to the dashboard and edit/create a new page. Look for the Page Attributes meta box on the right hand side and select the Landing Page template. Save the page.

Then you have a new landing page!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM