简体   繁体   中英

Should I create static pages in WordPress dashboard or as a separate PHP files?

I am new to WordPress. I am currently using version 4.9.12.

I have a static HTML website. I am converting this site into WordPress. Though I have created header.php, index.php, and footer.php files. My custom theme is ready. But I am now confused about my html static pages. I have some other html pages eg digital.html, seo.html. These pages has HTML plus a little css. Now what should I do for these pages? Should I create these static pages in WordPress dashboard (backend) or create separate PHP files named digital.php, seo.php etc.

In addition, I have a contact.html file too. This file has a form in it. So what should be right way to present contact form in WordPress. I want to retain my form and code. Should I create contact.php within my theme folder? Do I need to modify .htaccess file too to change url to mysite.com/contact ?

You can create a template with your custom name in root of your theme. This page templates display your site's static & dynamic content on a page, eg, posts, news updates, calendar events, media files, etc.

Add "Template Name: Contact page Template" in comment at top of your tamplate page after save it check in backend of this page at right side "Page Attributes" section. Select this tempate you have created from dropdown.

See this link for more detail: https://developer.wordpress.org/themes/template-files-section/page-template-files/

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