简体   繁体   中英

Calling php file on wordpress page

I have a php file which contains functions that connects with API. Functions in that file work correctly when tested from another php file. Website that should call this functions is written using wordpress. Since I'm not familiar with wordpress, how could I call them? For example: Website have login form which contains one button. On button click I also have to call my function which is implemented in external (self written) php file. I do know that button click is on client side and php is on server side. What bugs me is that when I saw source code of website I've seen that all pages are written in php but I can't navigate through them. What would be the easyest way to call this function on those button clicks?

You can include file like this:

you can load this file in current theme function.php

get_template_part('filename');

filename means your php file name.

add php file in your theme file.

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