gpt4 book ai didi

php - WordPress 使用自定义 php 文件

转载 作者:行者123 更新时间:2023-11-30 00:10:25 24 4
gpt4 key购买 nike

我已经在本地主机上创建了一个搜索引擎,但现在正在尝试将文件移动到 wordpress 上。

对于主题模板文件和文件管理器,我到底如何实现这一点?我有一个 search.html 文档作为开始,它调用 search.php 来获取 MYSQL 数据库的结果。

同时,我还有一个 search.inc.php 页面,用于自动建议,这些自动建议也是从数据库中提取的,并在您键入时出现我尝试将 search.html 代码插入 header.php 文件中。

搜索栏和按钮可见,但建议和搜索结果均不起作用。我尝试将 search.phpsearch.inc.php 插入与子主题和 header.php 相同的文件夹中,但无济于事。

我该如何处理这些文件,以便它们能够与我的 header.php 充分通信?

最佳答案

Please create a  page template file in your theme like :

<?php
/*
Template Name: My Custom Page
*/

and when you create a new page select this templete in admin panel.

now you can add any code what you want. this will communicate with you header file


for more details about page template visit :

http://codex.wordpress.org/Page_Templates

关于php - WordPress 使用自定义 php 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24114305/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com