Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting custom PHP code into a certain WordPress page

I'm in the process of integrating certain functionality into a WordPress site. I'm looking for a way to get this feature to work within a WordPress environment. (It's basically a page that lets users search certain things in a database.)

The site's current CMS allows me to insert custom PHP code into a page, so I wanna know if it's possible to insert PHP code into WordPress pages. Or would you recommend a different approach, perhaps?

like image 294
Pieter Avatar asked Sep 16 '10 13:09

Pieter


People also ask

Can I add custom code to WordPress page?

Use the Code Snippets Plugin The Code Snippets plugin is a great way to add custom code to WordPress sites, and is easier than creating your own plugin. It basically serves the same purpose as your own plugin, as custom code can be added without using your theme and in an upgrade-safe way.

Where do I put PHP files in WordPress?

php file will be located in the theme's directory. This will usually be the public_html/wp-content/themes/relevant-theme folder. For this example, we are using the default 2020 WordPress theme. Navigate to the theme's folder and search for the functions.

How do I change PHP code in WordPress?

Once you're logged in, you have access to your WordPress source files and can make HTML, CSS, PHP, and JS edits as you see fit. Simply right-click on any file and select View/Edit: When you've made your changes (again, be careful not to white screen your website), you can save the file.


1 Answers

Could you not create a custom template for the page?

like image 54
Martin Bean Avatar answered Sep 17 '22 13:09

Martin Bean