dongyushen9063 2015-01-11 18:27
浏览 93
已采纳

如何在wordpress页面中包含多个php文件?

I have created content that goes through a database and accesses information to then display it in multiple test files. I want to migrate this over to a page on a wordpress website. I have created a custom page page-slug.php and have inserted code for the basic html part, which is working fine, however I am having trouble getting the other php files it needs to access recognized by the include statements. It is working perfect when I have all of the files just displaying the content on the test url. I just need it to access the files such as connect.php, query.php, etc. I have placed the files into the wordpress custom theme folder as well. I also need the file to reference a couple jquery files as well as my php ones.

  • 写回答

1条回答 默认 最新

  • download12749 2015-01-12 00:59
    关注

    It's not entirely clear what is the situation and I have the feeling you have to fill up some gray areas in your understanding of how wordpress works basically - topics like enqueuing scripts and css files, using actions and filters (google it and try it), but:

    1. In order to including JS / CSS files, use: wp_enqueue_script (link) wp_enqueue_style (link)

    You have to use the "add_action" call in your functions.php file for a start (later on you can make a separate functions file)

    1. If you want to load php files inline, you can use for example the get_template_part function

    You really have to learn about these basic topics first: actions & filters / hooks, which are something like events / triggers in other systems enqueuing files to wordpress customizing your wordpress template creating a child theme - important

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 鼠标右键,撤销删除 复制 移动,要怎样删除
  • ¥15 使用MATLAB进行余弦相似度计算加速
  • ¥15 服务器安装php5.6版本
  • ¥15 我想用51单片机和数码管做一个从0开始的计数表 我写了一串代码 但是放到单片机里面数码管只闪烁一下然后熄灭
  • ¥20 系统工程中,状态空间模型中状态方程的应用。请猛男来完整讲一下下面所有问题
  • ¥15 我想在WPF的Model Code中获取ViewModel Code中的一个参数
  • ¥15 arcgis处理土地利用道路 建筑 林地分类
  • ¥20 使用visual studio 工具用C++语音,调用openslsx库读取excel文件的sheet问题
  • ¥100 寻会做云闪付tn转h5支付链接的技术
  • ¥15 DockerSwarm跨节点无法访问问题