SlideShare a Scribd company logo
1 of 26
Best Practices
On Making, Breaking, and Fixing WordPress Themes




    Philip Arthur Moore / Theme Wrangler at Automattic Inc.
WP_DEBUG

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 */

define( 'WP_DEBUG', true );

/**
 * For developers: Logging WordPress errors.
 *
 * PHP errors and notices will be logged to the file /wp-content/debug.log
 */

define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

/**
 * Find more default constants in /wp-includes/default-constants.php
 * Link: http://codex.wordpress.org/Editing_wp-config.php
 */
SCRIPT_DEBUG


/**
 * For developers: Load development versions of all scripts.
 *
 * Change this to true to load all non-minified scripts and CSS. When
 * SCRIPT_DEBUG is set to true compression and concatenation are disabled.
 */

define( 'SCRIPT_DEBUG', true );

/**
 * Find more script-related constants in /wp-includes/script-loader.php
 * Link: http://codex.wordpress.org/Editing_wp-config.php
 */
Important Plugins for Theme Development


Debug Bar: Adds a debug menu to the toolbar that shows query, cache, and other
helpful debugging information.
Debug Bar Console: Adds a PHP/MySQL console to the debug bar.
Log Deprecated Notices: Logs the usage of deprecated files, functions, and
function arguments, offers the alternative if available, and identifies where the
deprecated functionality is being used.
Regenerate Thumbnails: Allows you to regenerate all thumbnails after changing
the thumbnail sizes.
Reveal IDs: Show post, page, category, tag, and link IDs in the Dashboard.
RTL Tester: Allows quick rtl.css testing by adding a switch to the toolbar.
Theme-Check: Tests a WordPress theme against the latest WP standards.
WordPress Importer: Bulk content migration from site to site.
Debug Bar Provides Useful Query Information
Debug Bar Reports PHP Notices and Warnings
Debug Bar Console
Log Deprecated Notices
Regenerate Thumbnails
Regenerate Thumbnails
Regenerate Thumbnails
Reveal IDs for Admin
RTL Tester Quickly Checks rtl.css
RTL Tester Activated
Theme-Check
Theme-Check Finds Theme Errors
Unit Testing is Vital
Your Theme Should Respond Well To:
Long Site Titles: e.g. The point of using Lorem Ipsum is
that it has a more-or-less normal distribution of letters, as
opposed to using 'Content here, content here', making it
look like readable English.


Long Site Descriptions: e.g. Lorem Ipsum is simply dummy
text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived
not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was
popularised in the 1960s with the release of Letraset sheets
containing Lorem Ipsum passages, and more recently with
desktop publishing software like Aldus PageMaker including
versions of Lorem Ipsum.
Your Theme Should Respond Well To:
Index and Archive Pagination i.e. paged=2 or page/2

Threaded and Paginated Comments

Super Large Images $content_width check

Non-Default Permalinks i.e. /%year%/%monthnum%/%day%/
%postname%/

Super-Short and Super-Long Menus custom and non-custom

Custom Front Page and Posts Page i.e. site.com/blog/

Non-Titled Posts and Non-Content Posts

Password-Protected Content

Widgets i.e. 0, 1, or 20 widgets
http://codex.wordpress.org/Theme_Unit_Test
Test For Built-In WordPress Functionality
add_theme_support( $feature );
// Add default posts and comments RSS feed links to <head>.
add_theme_support( 'automatic-feed-links' );

// This theme uses Featured Images (also known as post thumbnails) for per-
post/per-page Custom Header images
add_theme_support( 'post-thumbnails' );

// Add support for a variety of post formats
add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery',
'status', 'quote', 'image' ) );

/**
 * Link: http://codex.wordpress.org/Function_Reference/add_theme_support
 */



          add_editor_style();
        add_custom_background();
          register_nav_menu();
       add_custom_image_header();
i18n
// i18n
load_theme_textdomain( 'autofocus', get_template_directory_uri() . '/languages' );

$locale = get_locale();
$locale_file = get_template_directory_uri() . "/languages/$locale.php";
if ( is_readable( $locale_file ) )
   require_once( $locale_file );

/**
 * Link: http://codex.wordpress.org/I18n_for_WordPress_Developers
 */
http://codex.wordpress.org/Theme_Review
Thanks

More Related Content

What's hot

Installation of wordpress
Installation of wordpressInstallation of wordpress
Installation of wordpressHAINIRMALRAJ
 
Getting started-with-zend-framework
Getting started-with-zend-frameworkGetting started-with-zend-framework
Getting started-with-zend-frameworkMarcelo da Rocha
 
Aloha Editor usage example
Aloha Editor usage exampleAloha Editor usage example
Aloha Editor usage exampleLaurin Herlt
 
Weblogic.deployer usage
Weblogic.deployer usageWeblogic.deployer usage
Weblogic.deployer usageBunty Ray
 
Akka sample using typesafe activator
Akka sample using typesafe activatorAkka sample using typesafe activator
Akka sample using typesafe activatorVijayananda Mohire
 
Troubleshooting mule
Troubleshooting muleTroubleshooting mule
Troubleshooting muleSon Nguyen
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with SeleniumKerry Buckley
 
Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaArafat Rahman
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in MuleKhasim Saheb
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with DrupalPromet Source
 
Getting anypoint studios all versions
Getting anypoint studios all versionsGetting anypoint studios all versions
Getting anypoint studios all versionsAnirban Sen Chowdhary
 
Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!AutomatedTester
 
Installation of Joomla on Windows XP
Installation of Joomla on Windows XPInstallation of Joomla on Windows XP
Installation of Joomla on Windows XPRupesh Kumar
 
Apex code-fundamentals
Apex code-fundamentalsApex code-fundamentals
Apex code-fundamentalsAmit Sharma
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaAgile Testing Alliance
 
Integration with CMIS using Mule ESB
Integration with CMIS using Mule ESBIntegration with CMIS using Mule ESB
Integration with CMIS using Mule ESBSanjeet Pandey
 
Magento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | MagenestMagento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | MagenestMagenest
 

What's hot (20)

Magento Meetup New Delhi- Console
Magento Meetup New Delhi- ConsoleMagento Meetup New Delhi- Console
Magento Meetup New Delhi- Console
 
Installation of wordpress
Installation of wordpressInstallation of wordpress
Installation of wordpress
 
Getting started-with-zend-framework
Getting started-with-zend-frameworkGetting started-with-zend-framework
Getting started-with-zend-framework
 
Aloha Editor usage example
Aloha Editor usage exampleAloha Editor usage example
Aloha Editor usage example
 
Weblogic.deployer usage
Weblogic.deployer usageWeblogic.deployer usage
Weblogic.deployer usage
 
Akka sample using typesafe activator
Akka sample using typesafe activatorAkka sample using typesafe activator
Akka sample using typesafe activator
 
Troubleshooting mule
Troubleshooting muleTroubleshooting mule
Troubleshooting mule
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 
Web Application Development using MVC Framework Kohana
Web Application Development using MVC Framework KohanaWeb Application Development using MVC Framework Kohana
Web Application Development using MVC Framework Kohana
 
Php
PhpPhp
Php
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
 
Wordpress multisite
Wordpress multisiteWordpress multisite
Wordpress multisite
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
 
Getting anypoint studios all versions
Getting anypoint studios all versionsGetting anypoint studios all versions
Getting anypoint studios all versions
 
Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!Selenium 2: The Future of Selenium is now!
Selenium 2: The Future of Selenium is now!
 
Installation of Joomla on Windows XP
Installation of Joomla on Windows XPInstallation of Joomla on Windows XP
Installation of Joomla on Windows XP
 
Apex code-fundamentals
Apex code-fundamentalsApex code-fundamentals
Apex code-fundamentals
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
Integration with CMIS using Mule ESB
Integration with CMIS using Mule ESBIntegration with CMIS using Mule ESB
Integration with CMIS using Mule ESB
 
Magento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | MagenestMagento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | Magenest
 

Similar to Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes

WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteBrendan Sera-Shriar
 
WordPress Ann Arbor: WP Tips and Tricks
WordPress Ann Arbor: WP Tips and TricksWordPress Ann Arbor: WP Tips and Tricks
WordPress Ann Arbor: WP Tips and Tricksoneilldec
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupalmayank.grd
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and pluginsStephanie Wells
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To DrupalLauren Roth
 
Getting Started With WordPress Development
Getting Started With WordPress DevelopmentGetting Started With WordPress Development
Getting Started With WordPress DevelopmentAndy Brudtkuhl
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1Yoav Farhi
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentationsasidhar
 
WordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPWordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPandrewnacin
 
CMS 101 Drupal
CMS 101 DrupalCMS 101 Drupal
CMS 101 Drupalggfergu
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
Step by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginMainak Goswami
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011David Carr
 
Connections customization lite
Connections customization liteConnections customization lite
Connections customization liteSharon James
 
WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopBrendan Sera-Shriar
 

Similar to Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes (20)

WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media Institute
 
WordPress Ann Arbor: WP Tips and Tricks
WordPress Ann Arbor: WP Tips and TricksWordPress Ann Arbor: WP Tips and Tricks
WordPress Ann Arbor: WP Tips and Tricks
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupal
 
W pthemes
W pthemesW pthemes
W pthemes
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and plugins
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
Getting Started With WordPress Development
Getting Started With WordPress DevelopmentGetting Started With WordPress Development
Getting Started With WordPress Development
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 
Asp.Net 2.0 Presentation
Asp.Net 2.0 PresentationAsp.Net 2.0 Presentation
Asp.Net 2.0 Presentation
 
WordPress 3.0 at DC PHP
WordPress 3.0 at DC PHPWordPress 3.0 at DC PHP
WordPress 3.0 at DC PHP
 
CMS 101 Drupal
CMS 101 DrupalCMS 101 Drupal
CMS 101 Drupal
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
Step by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress plugin
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011
 
Connections customization lite
Connections customization liteConnections customization lite
Connections customization lite
 
WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute Workshop
 

Recently uploaded

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes

  • 1. Best Practices On Making, Breaking, and Fixing WordPress Themes Philip Arthur Moore / Theme Wrangler at Automattic Inc.
  • 2. WP_DEBUG /** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that plugin and theme developers use WP_DEBUG * in their development environments. */ define( 'WP_DEBUG', true ); /** * For developers: Logging WordPress errors. * * PHP errors and notices will be logged to the file /wp-content/debug.log */ define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); /** * Find more default constants in /wp-includes/default-constants.php * Link: http://codex.wordpress.org/Editing_wp-config.php */
  • 3. SCRIPT_DEBUG /** * For developers: Load development versions of all scripts. * * Change this to true to load all non-minified scripts and CSS. When * SCRIPT_DEBUG is set to true compression and concatenation are disabled. */ define( 'SCRIPT_DEBUG', true ); /** * Find more script-related constants in /wp-includes/script-loader.php * Link: http://codex.wordpress.org/Editing_wp-config.php */
  • 4. Important Plugins for Theme Development Debug Bar: Adds a debug menu to the toolbar that shows query, cache, and other helpful debugging information. Debug Bar Console: Adds a PHP/MySQL console to the debug bar. Log Deprecated Notices: Logs the usage of deprecated files, functions, and function arguments, offers the alternative if available, and identifies where the deprecated functionality is being used. Regenerate Thumbnails: Allows you to regenerate all thumbnails after changing the thumbnail sizes. Reveal IDs: Show post, page, category, tag, and link IDs in the Dashboard. RTL Tester: Allows quick rtl.css testing by adding a switch to the toolbar. Theme-Check: Tests a WordPress theme against the latest WP standards. WordPress Importer: Bulk content migration from site to site.
  • 5. Debug Bar Provides Useful Query Information
  • 6. Debug Bar Reports PHP Notices and Warnings
  • 12. Reveal IDs for Admin
  • 13. RTL Tester Quickly Checks rtl.css
  • 18. Your Theme Should Respond Well To: Long Site Titles: e.g. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Long Site Descriptions: e.g. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  • 19. Your Theme Should Respond Well To: Index and Archive Pagination i.e. paged=2 or page/2 Threaded and Paginated Comments Super Large Images $content_width check Non-Default Permalinks i.e. /%year%/%monthnum%/%day%/ %postname%/ Super-Short and Super-Long Menus custom and non-custom Custom Front Page and Posts Page i.e. site.com/blog/ Non-Titled Posts and Non-Content Posts Password-Protected Content Widgets i.e. 0, 1, or 20 widgets
  • 21. Test For Built-In WordPress Functionality
  • 22. add_theme_support( $feature ); // Add default posts and comments RSS feed links to <head>. add_theme_support( 'automatic-feed-links' ); // This theme uses Featured Images (also known as post thumbnails) for per- post/per-page Custom Header images add_theme_support( 'post-thumbnails' ); // Add support for a variety of post formats add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) ); /** * Link: http://codex.wordpress.org/Function_Reference/add_theme_support */ add_editor_style(); add_custom_background(); register_nav_menu(); add_custom_image_header();
  • 23. i18n
  • 24. // i18n load_theme_textdomain( 'autofocus', get_template_directory_uri() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory_uri() . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); /** * Link: http://codex.wordpress.org/I18n_for_WordPress_Developers */

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n