How to Put Together a Mobile First, Performance Orientated WordPress Theme [Part 1] In its core, putting together a WordPress theme is a rather simple task.
WordPress delivers a really friendly environment and makes it clear which PHP functions to use for what purpose along the way. However. Even though it’s simple, it’s far from easy, and especially if you want your theme to be mobile-optimized. There’s a range of unique issues that you ought to overcome if you want to end up with a quality product that loads fast, operates in a predictable way, and (what’s the most important thing) is user-friendly and accessible to people using different devices and screen sizes. This two-part guide will walk you through the process in 10 steps, listing the most important things to take care of when building a mobile first, performance orientated WordPress theme.
For part 2, see here: How to Put Together a Mobile First, Performance Orientated WordPress Theme [Part 2] 1. Things worth doing: 2. Image optimization is even more important for mobile than for any other scenario. 3. 4. 5. 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.
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. But how does it all work? In this article, I’ll show you how to use post type templates in your themes with a few easy examples. Toolset - Develop WordPress Sites with No Coding.
Troubleshooting White Screen of Death Errors in WordPress. Sometimes WordPress just stops working.
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. 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.
This page describes the various debugging tools in WordPress and how to be more productive in your coding as well as increasing the overall quality and interoperativity of your code. Query Monitor — WordPress Plugins. Query Monitor is a debugging plugin for anyone developing with WordPress.
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.
Also you can perform simple actions like empty the file or deleting it. Using The WordPress Debug Log. Do you ever make mistakes?
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?
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. If you're new to web design, you might also enjoy my easy PHP 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.
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?