Search Results for PHP
Web Design & IT Services in Swanage, Poole, Bournemouth and Dorset by Matthew Pond
Tags
How do I get PHP errors to display?
Display errors is usually always turned off in the php.ini or your Apache config file to stop the wrong people seeing details of your server if something goes wrong. When debugging code I always add the following three lines to the top of the script I am looking at: That prints out all the errors I need.
Fatal error: Call to undefined function post_exists()
The files in wp-admin are only loaded when you’re in the admin area… when you’re looking at pages or posts those functions aren’t loaded. In that case you’d need to require the file first, so you’d want to do something like this in your function:
Get list of all product categories in WooCommerce
The following code will output all the product categories in WooCommerce as a list of links:
Laravel Project Setup
Install via Composer You can install Laravel by issuing the Composer create-project command in your terminal: Once the project is installed you can view in your brower, you will need to point your local server to the public folder. Or you can also run the following command to start a development server on http://127.0.0.1:8000. Once … Continued
Writing Code in Your WordPress Posts
To set your code aside so that it looks like a box of code which may be copied and pasted within other code or template file, you can use the <pre> HTML tag. The <pre> tag instructs the browser to use a monospaced font, but to exactly reproduce whatever is inside of the <pre> tags. Every space, line break, every bit of code … Continued
ACF Pro Composer Install
When installing Advanced Custom Fields (ACF) Pro via composer I was getting the following error: “The requested package advanced-custom-fields/advanced-custom-fields-pro could not be found in any version, there may be a typo in the package name.” To resolve this I had to add a custom repository to my composer.json file in the repositories section: { “type”: … Continued