I have a HTML form that user can interact with and insert the data to a database. ( One HTML form and about 3 pages .php ) I need to implement this form to a word press page. I created a page in wordpress and it gives me a blank area to write my content but i don't know where i put my files. so appreciate your support to help me , thanks .
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率

将PHP页面添加到wordpress
收起
- 写回答
- 好问题 0 提建议
- 关注问题
微信扫一扫
点击复制链接分享
- 邀请回答
- 编辑 收藏 删除 结题
- 收藏 举报
2条回答 默认 最新
- 关注
码龄 粉丝数 原力等级 --
- 被采纳
- 被点赞
- 采纳率
duanlinpi0265 2014-12-03 04:19关注Where you place your files depends greatly on the structure of your wordpress template. If you want to make a page that can be accessed via a url like "www.yourdomain.com/form", then you can make a "Page" in Wordpress (via the "Page" panel via the dashboard), and name it "Form" and then, in your form's HTML (or PHP) file, set your HTML up as a template using this syntax:
Put this at the very top of your PHP page that contains your form's HTML/PHP:
<?php /* Template Name: My Form Page */
The code comment above is something wordpress will look for exclusively, and tells the wordpress engine that this page (your form HTML) is now a template named 'My Form Page'. So now, in the Wordpress Page editor for your "Form" page, you can attach your new template to your newly-created "Form" page by selecting "My Form Page" from the Template Dropdown in the Page editor.
Here is a screenshot of what the "Template Dropdown" looks like (per the Wordpress documentation):
After you follow these steps, navigating to this page will reveal your form's HTML, instead of a blank page.You should refer to the Wordpress documentation on Page Templates for more information:
Hope this helps!
本回答被题主选为最佳回答 , 对您是否有帮助呢? 本回答被专家选为最佳回答 , 对您是否有帮助呢? 本回答被题主和专家选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏举报微信扫一扫
点击复制链接分享
编辑预览轻敲空格完成输入- 显示为
- 卡片
- 标题
- 链接
评论按下Enter换行,Ctrl+Enter发表内容

- 显示为
- 卡片
- 标题
- 链接
报告相同问题?
- 2013-05-29 10:24回答 3 已采纳 The problem is that you're setting the action for your form directly to your template file (using
- 2017-12-05 08:32回答 1 已采纳 you didn't include .JS file in <script src="something.js"> . you have included it in <lin
- 2018-05-28 03:06回答 2 已采纳 You can achieve using 2 methods. 1) Add your static image directly at the beginning of archive-pr
- 2020-08-30 18:57culi3118的博客 WordPress lets us add custom meta boxes to posts, pages and custom post types via the admin interface. WordPress also provides APIs to customize ... WordPress允许我们通过管理界面将自定义元框添加到帖子...
- 2010-05-11 03:12回答 18 已采纳 You don't need to interact with the API or use a plugin. First, duplicate post.php or page.php in
- 2016-08-22 04:55回答 2 已采纳 You have to create Page template for gallery section. <?php /** * Template Name: Gallery * *
- 2016-10-18 09:29回答 1 已采纳 I believe that ^$ matches the root of a host. Try adding this to the top of your .htaccess file.
- 2020-09-12 22:02cumyupx7788305的博客 wordpress谷歌字体One of the most important step in optimizing your WordPress site for SEO is adding it to Google Search Console ... 为您的SEO优化WordPress网站的最重要步骤之一就是将其添加到Googl...
- 2018-04-18 00:11回答 2 已采纳 You can combine WordPress build-in constants and PHP's ini settings. Place these lines in your w
- 2015-09-03 08:23回答 2 已采纳 I've fixed this with the below solution: <?php query_posts('post_type=post&post_status=publis
- 2017-09-04 20:49回答 1 已采纳 You can use something like this for example, using $_SERVER['REQUEST_URI'] to get the url path and
- 2020-06-21 12:57cunjie3951的博客 从共享新闻到社交互动和协作,WordPress允许您向公司Intranet添加功能,以帮助您更有效地进行团队沟通和共享资源。 您可能想通过Intranet共享的一种资源是日历。 您不仅可以使用它来预定会议,还可以提供将影响...
- 2020-09-07 05:23cumyupx7788305的博客 wordpress自定义Did you know that anyone can easily find your WordPress login URL. Recently, one of our readers asked if it was possible to change the default WordPress login URL to a custom login URL....
- 2023-06-19 09:16moshi_6的博客 将采集文章发布到WordPress系统快讯: 1. 获取wordpress快讯的post_type值; 2. 对接wordpress发布插件,设置post类型为newsflashes或者news-category; 3. 智能简数采集器自动采集发布数据到wordpress网站快讯处;
- 2020-06-15 06:04cunjie3951的博客 WordPress 页面模板是一种完全改变特定网页显示方式的好方法。 您可以使用它们为您的站点添加各种功能。 但是,它们确实有一个局限性,因为它们是“静态”模板。 您不能自定义它们或以任何方式影响它们的行为。 您...
- 没有解决我的问题, 去提问
- 京ICP备19004658号
- 经营性网站备案信息
公安备案号11010502030143
- 营业执照
- 北京互联网违法和不良信息举报中心
- 家长监护
- 中国互联网举报中心
- 网络110报警服务
- Chrome商店下载
- 账号管理规范
- 版权与免责声明
- 版权申诉
- 出版物许可证
- ©1999-2025北京创新乐知网络技术有限公司