background preloader

WordPress Development

Facebook Twitter

Coding WordPress...

A Quick and Dirty Guide to Post Type Templates in WordPress 4.7. WordPress 4.7 has delivered some fantastic new enhancements to the CMS’s template system.

A Quick and Dirty Guide to Post Type Templates in WordPress 4.7

Templates have now been expanded to include all post types, allowing developers to create more nuanced themes and at the same time allowing site owners to manage content more easily. Toolset - Develop WordPress Sites with No Coding. Troubleshooting White Screen of Death Errors in WordPress. Sometimes WordPress just stops working.

Troubleshooting White Screen of Death Errors in WordPress

When you visit your site you’re met with is a stark white page and nothing else. It’s aptly referred to as the “white screen of death.” It can be extremely frustrating and problematic ,to say the least, especially when you don’t see and PHP errors listed to tip you off as to the cause of the error. You could guess what the problem is, but that could take too long. Luckily, there are steps you can take to quickly troubleshoot the problem. In this Weekend WordPress Project, we’ll take a look at the troubleshooting process for white screen errors, which includes a bit of coding or using plugins. Debugging in WordPress. Languages: English • Español • Français • Hrvatski • Italiano • 日本語 • Português do Brasil • (Add your language) Debugging PHP code is part of any project, but WordPress comes with specific debug systems designed to simplify the process as well as standardize code across the core, plugins and themes.

Debugging in WordPress

Query Monitor — WordPress Plugins. Query Monitor is a debugging plugin for anyone developing with WordPress.

Query Monitor — WordPress Plugins

It has some advanced features not available in other debugging plugins, including debugging of AJAX calls, REST API requests, redirects, and the ability to narrow down its output by plugin or theme. For complete information, please see Query Monitor's GitHub repo. Here's an overview of what's shown: Database Queries Shows all database queries performed on the current requestShows affected rows and time for all queriesShows notifications for slow queries, duplicate queries, and queries with errorsFilter queries by query type (SELECT, UPDATE, DELETE, etc)Filter queries by component (WordPress core, Plugin X, Plugin Y, theme)Filter queries by calling functionView aggregate query information grouped by component, calling function, and typeSuper advanced: Supports multiple instances of wpdb on one page (more info in the FAQ)

Developer. Debug Bar. Log Viewer — WordPress Plugins. ** The plugin is recommended to use only in development. ** This plugin provides an easy way to view any *.log files directly in admin panel.

Log Viewer — WordPress Plugins

Also you can perform simple actions like empty the file or deleting it. To activate WordPress logging to file you have to set define( 'WP_DEBUG_LOG', true ); in your wp-config.php file. There is an first integration for a panel to the Debug Bar Plugin. If you're experiencing problems please report through support forum or check FAQ section. Known limitations / Bugs: Autorefresh is currently fixed at 15 seconds if enabled - will let you choose custom timing soonafter an action in files view a wp_redirect should be called but there's already output present so not working. Using The WordPress Debug Log. Do you ever make mistakes?

Using The WordPress Debug Log

I do. The first step to fixing your mistakes is knowing what the mistake is. I can’t solve all of your problems, but I can help fix those that are generated by PHP code on your WordPress site by helping you work with debug logs. A few weeks ago, when I wrote about customizing your WordPress site’s wp-config.php file, I covered settings for debugging. I covered both how to show errors, and when you might not want to do that. For these reasons, on a live site, its a good idea to leave WP_DEBUG enabled, but to prevent errors from being displayed. Logging errors, even when you’re displaying them is still useful as having a record of your errors is often very useful in development.

Setting Up This is a brief review of what I discussed in my wp-config article. Turn on WordPress' WP_DEBUG_LOG but without E_STRICT. Accompanying blog post: Leveraging Chrome Developer Tools for WordPress Development. WordPress hooks database - action and filter hooks for wp plugin developers. What is a hook?

WordPress hooks database - action and filter hooks for wp plugin developers

In brief, WordPress hooks enable you to change how WordPress behaves without editing any core files. Because you leave the WordPress files untouched, you can painlessly upgrade your blog with each new version of WordPress. It's this hooks architecture that makes WordPress the best blogging solution. If you don't know what WordPress hooks are for, read the Plugin API or this tutorial. A Walkthrough on Conditional Tags in WordPress: Introduction - Tuts+ Code Tutorial. One of the most important strengths of WordPress is the extensibility of the core.

A Walkthrough on Conditional Tags in WordPress: Introduction - Tuts+ Code Tutorial

With plugins and themes, WordPress users have been able to mold their websites for almost a decade. (WordPress was first released in 2003, but plugins were introduced in 2004 and themes were introduced in 2005.) And to create such a solid infrastructure, WordPress includes lots of handy sub-systems (functions, classes or whole APIs). One of them is "Conditional Tags", which allow our code to function differently in particular situations.

In this series, we're going to learn about these Conditional Tags. Let's begin! In the Codex, Conditional Tags are described like this: The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. Your Code: Hey man, I need some help. Let's have a quick example of how a Conditional Tag works: Get it?