admin管理员组

文章数量:1122832

My professional background is backend engineering, but I volunteered to help a nonprofit, and their website runs on wordpress, so I wrote some php that solves a problem for them, which I tested by running locally (via /).

I had planned to get this code onto their live website, and recommendations that I've found online suggest uploading the php via ftp, using it to create a new template, and making a wordpress page using that template.

My problem is that the nonprofit I'm talking to doesn't know much about their wordpress instance, and their webmaster has been very noncommunicative, and I'm not sure how much he knows about wordpress beyond what he can access in the admin UI.

Besides FTP uploading, what options do I have to implement custom php in a wordpress site? I have an admin login.

Sorry to be verbose, thanks in advance!

My professional background is backend engineering, but I volunteered to help a nonprofit, and their website runs on wordpress, so I wrote some php that solves a problem for them, which I tested by running locally (via https://localwp.com/).

I had planned to get this code onto their live website, and recommendations that I've found online suggest uploading the php via ftp, using it to create a new template, and making a wordpress page using that template.

My problem is that the nonprofit I'm talking to doesn't know much about their wordpress instance, and their webmaster has been very noncommunicative, and I'm not sure how much he knows about wordpress beyond what he can access in the admin UI.

Besides FTP uploading, what options do I have to implement custom php in a wordpress site? I have an admin login.

Sorry to be verbose, thanks in advance!

Share Improve this question asked Jul 15, 2024 at 23:18 eipxeneipxen 1011 bronze badge 5
  • 4 "I wrote some php that solves a problem for them" - where did you put this on your local site? As a new plugin? In a theme (you did say template)? Your options, if you really can't access the file system, are probably upload a new plugin or upload a new version of their theme or a child theme, but which really depends on what this code does (logic only? adds HTML?) and obviously where you put it when you tested it. – Rup Commented Jul 16, 2024 at 0:46
  • If you are allowed to install plugins, you can install a plugin like "File Manager" which gives you access to files and download files from it. This is not the best thing to do, because if you download a file that creates an error, you won't be able to recover from it. But it's a starting point... – Pof Commented Jul 16, 2024 at 13:01
  • I would recommend the most used plugin (and it's free) for this case: File Manager. You can install it via CMS. Please take in advance that you still need FTP access to undo the code if you've uploaded an error file or there is something wrong with your code uploading using the File Manager plugin. – Dao Commented Jul 17, 2024 at 7:44
  • 1 it sounds like you need to track down their hosting details, starting with figuring out who they're paying and from where. You'll need to do this even if you figure out another method as anything that brings down the site will need this. The answer to this will also depend enormously on the host and the type of hosting they bought. E.g. a wp.com site won't provide FTP on all plans, some hosts use git for deployments, and some use read only filesystems for plugins/themes for security reasons that eliminate using editors and plugins in WP itself – Tom J Nowell Commented Jul 17, 2024 at 8:26
  • As @Rup said, the best method here is to build a plugin that adds the functionality. – Tony Djukic Commented Jul 22, 2024 at 18:34
Add a comment  | 

1 Answer 1

Reset to default 1

I don't know if that answers your question. But if you have a child theme in FTP, you can go to wp-content -> theme -> The folder of your child theme, here you will find everything you need.

Otherwise if you only have a parent theme, you can still create a child theme, but the design risks being broken. Otherwise, there are plugins to integrate code for PHP

本文标签: Options for using custom PHP in a wordpress site No FTP access