How do I debug a WordPress plugin?

There’s this excellent Q&A at WordPress Stack Exchange, lots of knowledgeable folks explaining their debugging techniques: How do you debug plugins? In the Javascript arena you basically need <script>console.log(‘the value is’ + variable);</script>. And use Google Chrome inspector and/or Firebug. In PHP, it depends on where things are happening or where you want the output. … Read more

WordPress wp_title blank on index page

Here’s is what I read from Codex: If you are using a custom homepage with custom loops and stuff, you will have an empty wp_title. Here goes a neat hack to add the description/tagline at the wp_title place on homepage: <title><?php bloginfo(‘name’); ?> | <?php is_front_page() ? bloginfo(‘description’) : wp_title(”); ?></title> So use is_front_page() to … Read more

Can I host my wordpress blog on github pages as a static webpage

This website gives a good answer on how to do this: https://www.hywel.me/static/site/wordpress/2016/07/17/fast-free-static-website-with-wordpress-and-github-pages.html In short: Set-up GitHub pages. Install Simply static plugin into WordPress. Push the export from the plug-in back to your git repository and you are done!

wordpress permalinks not working – htaccess seems ok but getting 404 error on pages

For other people landing on this page – Another issue could be (If you are using Apache as your web server) is your httpd.conf or your sites-available/sitename.conf file needs editing. Your web directory will need to allow the .htaccess file to override it’s settings. look for your web dir in the file – it will … Read more

WordPress – $wpdb->insert – MySQL NOW()

I believe the canonical approach is to use the WordPress current_time() function passing it ‘mysql’ as the first parameter to specify a mysql timestamp compatible format (the alternative is UNIX timestamp format) and ‘1’ as the second parameter to specify GMT time (default is local), like this: $data = array( ‘id’ => NULL, ‘order’ => … Read more