0

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!

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 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 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 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 at 8:26
  • As @Rup said, the best method here is to build a plugin that adds the functionality. Commented Jul 22 at 18:34

1 Answer 1

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

2
  • do you have any recommendations for plugins to integrate php? I'm very new to this world, and want to give this company a project that's as self contained as possible in case something breaks, or they want something changed thank you for your suggestion!
    – eipxen
    Commented Jul 17 at 20:45
  • I never use this type of plugin, but try to see with this one. I've seen it circulated a lot in tutorials. fr.wordpress.org/plugins/code-snippets
    – user188850
    Commented Jul 18 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.