WordPress post insertion from PHP file

The PHP way If you want to use PHP, you can use wp_insert_post to insert posts programatically. Basically you want to provide an array of post information (title, content, date…). You can read more about it here: https://developer.wordpress.org/reference/functions/wp_insert_post/ But the problem is you should not run that function to import all 100 posts. I used … Read more

Unexpected behavior when trying to manually install WordPress on macOS Sierra

Thanks to Jacob P. for pointing me in the right direction. The fix was simple once I saw that the site was not serving CSS resources. Since my site was indeed using https (and not http), simply changing the following in wp-config.php: define(‘WP_HOME’,’http://www.my.server.com‘); define(‘WP_SITEURL’,’http://www.my.server.com‘); To (note the https): define(‘WP_HOME’,’https://www.my.server.com’); define(‘WP_SITEURL’,’https://www.my.server.com’); solved the problem for me.

The plugin generated 225 characters of unexpected output during activation

I solved this issue. Problem was in way I was using register_activation_hook. I loaded TbybInstall along with other classes: /* * Load classes */ require plugin_dir_path( __FILE__ ) . ‘classes/class.PreparedCarts.php’; require plugin_dir_path( __FILE__ ) . ‘classes/class.ReturnOptions.php’; require plugin_dir_path( __FILE__ ) . ‘classes/class.TbybInstall.php’; …and I used register_activation_hook in a way which is more similar to official … Read more

Case insensitive ORDERBY in wpquery

As stated above, your orderby parameter should be set to meta_value, not restaurant. Using phpMyAdmin or some other tool, look at your database. With any newer installation of WordPress, your tables should have a collation of utf8mb4_unicode_ci. That means that the table is storing its data in UTF-8 4-byte unicode character set. That “ci” at … Read more

How to configure WordPress Database for CentOS 7

Try to disable temporarily SELinux on the web server, with the command: sudo setenforce 0 If the error disappears after disabling SELinux, re-enable it with: sudo setenforce 1 and then allow httpd to connect to a MySql server through the network with: sudo setsebool -P httpd_can_network_connect_db 1 sudo setsebool -P httpd_can_network_connect 1