Set Up Valet on macOS for Local WordPress Development

valet-wordpress-development

This is a guide on how to set up Laravel Valet on macOS for a WordPress local development environment. Using Valet as a WordPress local development solution has the main benefits of speed, being lightweight and using fewer configurations to…

Converting MySQL/MariaDB database tables from MyISAM to InnoDB

Myisam Convert Innodb Storage Engine Wordpress

The InnoDB storage engine in MySQL/MariaDB is more performant than MyISAM – here are a few ways to change that database structure, using both the command line and also some WordPress plugins.Changing from MyISAM to InnoDB via the command lineIf…

Add and install PHP to macOS Monterey 12 with Homebrew

Php8 Macos Update

The latest macOS version Monterey 12 has removed PHP altogether from its operating system, there is a comment in the Apache config file httpd.conf that says:#PHP was deprecated in macOS 11 and removed from macOS 12Fortunately you can install PHP…

Updating to PHP versions 7.4 and 8 on macOS 11 Big Sur and Catalina

Php8 Macos Update

The latest macOS versions of Big Sur and Catalina currently ship with PHP 7.3 and have a deprecation notice that they intend to drop support for PHP altogether in a future upgrade.You can see this by running a <? phpinfo();…

How to connect to a MySQL or mariadb database with PHP

Php Connect Mysql Output Data

This tutorial will require a mysql database set up with a database user and password and a web development environment using mysql or mariadb, apache and php and a simple text editor. The tutorial takes you through establishing a mysql…

Add Copyright Symbol and Year Date in PHP

Php Copyright Year

To add a copyright symbol and year date in PHP that updates with the current year, you can use the code below… &copy; <?php echo date (‘Y’); ?> An HTML entity is used for the copyright symbol, then you have…

Target WooCommerce Products and Pages Using PHP Conditionals

shop

WooCommerce comes with a number of pages and a custom post type named ‘products’, sometimes you may want to just target some of these products or pages so you can add some PHP custom code in your functions.php file of your…

Set a conditional argument for multiple Custom Post Types in WordPress

cpts-conditionals

You can set a conditional argument for multiple custom post types in WordPress using in_array The format is like so… if( in_array( get_post_type(), array( ‘treatment’, ‘package’ )) ) {//add in cpts here // do stuff } else { //what all the other…

Using wp_localize_script with jQuery variables including strings, booleans and integers

set a jquery value via wp-localize-script

The use of wp_localize_script is an API in WordPress is to retrieve PHP values from the database to use in javascript/jquery scripts, it can also be utilized to make string values language translatable if required, but also used to pass user defined variables/settings say…