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?
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.
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.
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.
Could you not create a custom template for the page?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With