SlideShare a Scribd company logo
Best Practices in 
WordPress Development 
Presented By: 
Maruti Prasad Mohanty 
Team CMS 
Date: 4th September 2014
About Me: 
Certifications: 
● Microsoft Specialist certification in HTML5 with JavaScript and CSS3 
● Vskills WordPress Developer 
Stay in touch: 
https://www.facebook.com/maruti.mohanty 
https://twitter.com/maruti_mohanty 
mfsi_marutim 
marutim@mindfiresolutions.com
Today's Agenda 
● About WordPress 
● Child theme 
● WordPress Hooks 
● Removing all warning and notices 
● Use WordPress functons and libraries 
● Function Naming and declaration
Today's Agenda 
● About WordPress 
● Child theme 
● WordPress Hooks 
● Removing all warning and notices 
● Use WordPress functons and libraries 
● Function Naming and declaration
About WordPress 
WordPress is web software you can use to create a beautiful website or blog. 
We like to say that WordPress is both free and priceless at the same time. 
Says “WordPress.org” 
WordPress is the most popular CMS consisting of 23% of the total websites 
and 60.7% of the total CMS available. 
Says “w3techs.com”
About WordPress 
List of some popular people, companies using Wordpress: 
● Google Ventures 
● Sony Music 
● The New York Times 
● Time 
● BBC America 
● Tech Crunch 
● VanHeusen 
● Ebay (Blog) 
● Mozilla (Blog) 
● Rackspace (Blog) 
● Ford 
● Justin Timberlake 
● Justin Bieber 
● Usain Bolt
Child Theme 
A child theme is a theme that inherits the functionality of another theme, called 
the parent theme. 
Child themes allow you to modify, or add to the functionality of that parent theme. 
A child theme is the best, safest, and easiest way to modify an existing theme, 
whether you want to make a few tiny changes or extensive changes. 
Instead of modifying the theme files directly, you can create a child theme and 
override within.
Child Theme 
How to Create a Child Theme: 
In the child theme directory, create a file called style.css. This is the only file 
required to make a child theme. The style sheet must start with the following lines: 
/** 
* Theme Name: Twenty Fourteen Child 
* Description: Twenty Fourteen Child Theme 
* Template: twentyfourteen 
*/ 
@import url("../twentyfourteen/style.css"); 
/** 
* Theme Name: Twenty Fourteen Child 
* Description: Twenty Fourteen Child Theme 
* Template: twentyfourteen 
*/ 
@import url("../twentyfourteen/style.css");
Child Theme 
Template Files: 
functions.php 
Unlike style.css, the functions.php of a child theme does not override its 
counterpart from the parent. Instead, it is loaded in addition to the 
parent’s functions.php. (Specifically, it is loaded right before the parent’s file.) 
You can directly override other template files like header.php, footer.php, 
single.php, or page.php etc.
WordPress Hooks 
WordPress hooks are, essentially, triggers of sorts that allow users to, with 
short snippets of code, modify areas a WordPress theme or plugin, or add their 
own code to various parts of WordPress without modifying the original files. 
Hooks can be divided into “Action” and “Filter” hooks, the former allowing for 
insertion of custom code at various points and the latter allowing for the 
manipulation of various bits of content.
WordPress Hooks 
Action: 
do_action( 'before_signup_form' ); 
add_action( 'before_signup_form', 'my_function' ); 
function my_function() { 
do_action( 'before_signup_form' ); 
add_action( 'before_signup_form', 'my_function' ); 
function my_function() { 
// // Codes Codes goes goes here 
here 
} 
} 
Filter: 
apply_filters( 'excerpt_length', 55 ); 
add_filter( 'excerpt_length', 'my_function' ); 
Function my_function() { 
apply_filters( 'excerpt_length', 55 ); 
add_filter( 'excerpt_length', 'my_function' ); 
Function my_function() { 
// Codes goes here 
} 
// Codes goes here 
}
Remove All Warning 
and Notices 
One of the most important files in your WordPress installation is the 
wp-config.php file. This file is located in the root of your WordPress file 
directory and contains your website's base configuration details, such as 
database connection information 
define( 'WP_DEBUG', true ); 
define( 'WP_DEBUG_LOG', false ); 
define( 'WP_DEBUG', true ); 
define( 'WP_DEBUG_LOG', false ); 
WP_DEBUG to true also raises the error reporting level to E_ALL and 
activates warnings when deprecated functions or files are used;
Use WordPress Functions 
and Libraries 
Always check if whatever you're trying to do is possible to do it with WordPress core 
functions and libraries. That way, your scripts will be less prone to vulnerabilities and 
if some appears, they will be fixed by the WordPress core contributors and you won't 
have to worry to contact all of your clients. 
add_add_image_image_size() size() instead instead of of Tim Tim Thumb Thumb library 
library 
wp_wp_remote_remote_get() get() and and wp_wp_remote_remote_post() post() instead instead of of cURL 
cURL 
get_get_template_template_part() part() instead instead of of require() require() or or include() 
include()
Function Naming 
and Declaration 
Name collisions occur when a function has the same name as a function that's 
already been defined. For example, if in your theme you have a function called 
get_the_post_terms() and you install a plugin that have a function with the same 
name you will get something like: 
Fatal error: Cannot redeclare get_the_post_terms() (previously Fatal error: Cannot redeclare get_the_post_terms() (previously d deecclalarreedd i nin........ 
So it is advisable to add unique prefixes to your function name inspired from 
your theme or project 
fufunncctitoionn m mfsfs__ggeet_t_ththee__ppoosst_t_teterrmmss(())
Function Naming 
and Declaration 
Use function_exists() 
function_exists approach allows for a child theme to override the function definition 
by simply defining the function themselves. Since child theme's functions.php files 
load first, then they will define the function first and the parent's definition will not 
get loaded. 
If ( ! function_exists( 'my_function' ) ) { 
If ( ! function_exists( 'my_function' ) ) { 
function my__function( ) { 
function my__function( ) { 
// Code goes here; 
} 
} 
// Code goes here; 
} 
}
References 
● http://code.tutsplus.com 
● http://code.tutsplus.com/articles/tips-for-best-practices-in-wordpress-development-- 
cms-20649 
● https://wordpress.org
Any Question(s)
Best practices in WordPress Development

More Related Content

What's hot

WordPress Plugin Development For Beginners
WordPress Plugin Development For BeginnersWordPress Plugin Development For Beginners
WordPress Plugin Development For Beginners
johnpbloch
 
Secure All The Things!
Secure All The Things!Secure All The Things!
Secure All The Things!
Dougal Campbell
 
Plugins at WordCamp Phoenix
Plugins at WordCamp PhoenixPlugins at WordCamp Phoenix
Plugins at WordCamp Phoenix
Andrew Ryno
 
Wordpress Plugin Development Short Tutorial
Wordpress Plugin Development Short TutorialWordpress Plugin Development Short Tutorial
Wordpress Plugin Development Short Tutorial
Christos Zigkolis
 
Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress
Maurizio Pelizzone
 
Wordpress as a framework
Wordpress as a frameworkWordpress as a framework
Wordpress as a framework
Aggelos Synadakis
 
CSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsCSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the Guts
Dougal Campbell
 
WordPress Hardening
WordPress HardeningWordPress Hardening
WordPress Hardening
Maurizio Pelizzone
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
Christopher Ross
 
WordPress Plugins You Cannot Live Without
WordPress Plugins You Cannot Live WithoutWordPress Plugins You Cannot Live Without
WordPress Plugins You Cannot Live Without
Internet Marketing Muscle
 
Think Before You Submit Themes on WordPress dot Org
Think Before You Submit Themes on WordPress dot OrgThink Before You Submit Themes on WordPress dot Org
Think Before You Submit Themes on WordPress dot Org
Kafle G
 
7. mastering wordpress
7. mastering wordpress7. mastering wordpress
7. mastering wordpress
MoreNiche
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
markparolisi
 
Odoo - CMS dynamic widgets
Odoo - CMS dynamic widgetsOdoo - CMS dynamic widgets
Odoo - CMS dynamic widgets
Odoo
 
Views Style Plugins
Views Style PluginsViews Style Plugins
Views Style Plugins
mwrather
 
Object Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin DevelopmentObject Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin Development
mtoppa
 
Learn word press-from-scratch
Learn word press-from-scratchLearn word press-from-scratch
Learn word press-from-scratch
Emma Page
 
Odoo - Create themes for website
Odoo - Create themes for websiteOdoo - Create themes for website
Odoo - Create themes for website
Odoo
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
Alex S
 

What's hot (20)

WordPress Plugin Development For Beginners
WordPress Plugin Development For BeginnersWordPress Plugin Development For Beginners
WordPress Plugin Development For Beginners
 
Secure All The Things!
Secure All The Things!Secure All The Things!
Secure All The Things!
 
Plugins at WordCamp Phoenix
Plugins at WordCamp PhoenixPlugins at WordCamp Phoenix
Plugins at WordCamp Phoenix
 
Wordpress Plugin Development Short Tutorial
Wordpress Plugin Development Short TutorialWordpress Plugin Development Short Tutorial
Wordpress Plugin Development Short Tutorial
 
Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress
 
Wordpress as a framework
Wordpress as a frameworkWordpress as a framework
Wordpress as a framework
 
CSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsCSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the Guts
 
WordPress Hardening
WordPress HardeningWordPress Hardening
WordPress Hardening
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
WordPress Plugins You Cannot Live Without
WordPress Plugins You Cannot Live WithoutWordPress Plugins You Cannot Live Without
WordPress Plugins You Cannot Live Without
 
Think Before You Submit Themes on WordPress dot Org
Think Before You Submit Themes on WordPress dot OrgThink Before You Submit Themes on WordPress dot Org
Think Before You Submit Themes on WordPress dot Org
 
7. mastering wordpress
7. mastering wordpress7. mastering wordpress
7. mastering wordpress
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Odoo - CMS dynamic widgets
Odoo - CMS dynamic widgetsOdoo - CMS dynamic widgets
Odoo - CMS dynamic widgets
 
Views Style Plugins
Views Style PluginsViews Style Plugins
Views Style Plugins
 
Object Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin DevelopmentObject Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin Development
 
Learn word press-from-scratch
Learn word press-from-scratchLearn word press-from-scratch
Learn word press-from-scratch
 
Odoo - Create themes for website
Odoo - Create themes for websiteOdoo - Create themes for website
Odoo - Create themes for website
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 

Viewers also liked

Saigon Wordpress Meetup - Best practices for plugin development - A WordPress...
Saigon Wordpress Meetup - Best practices for plugin development - A WordPress...Saigon Wordpress Meetup - Best practices for plugin development - A WordPress...
Saigon Wordpress Meetup - Best practices for plugin development - A WordPress...
Triết Sài Gòn
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
Taylor Lovett
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
Taylor Lovett
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
Taylor Lovett
 
Sanitizing, Validating and Escaping in WordPress Themes and Plugins
Sanitizing, Validating and Escaping in WordPress Themes and PluginsSanitizing, Validating and Escaping in WordPress Themes and Plugins
Sanitizing, Validating and Escaping in WordPress Themes and Plugins
Micah Wood
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
Manish Jain
 

Viewers also liked (6)

Saigon Wordpress Meetup - Best practices for plugin development - A WordPress...
Saigon Wordpress Meetup - Best practices for plugin development - A WordPress...Saigon Wordpress Meetup - Best practices for plugin development - A WordPress...
Saigon Wordpress Meetup - Best practices for plugin development - A WordPress...
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
 
Sanitizing, Validating and Escaping in WordPress Themes and Plugins
Sanitizing, Validating and Escaping in WordPress Themes and PluginsSanitizing, Validating and Escaping in WordPress Themes and Plugins
Sanitizing, Validating and Escaping in WordPress Themes and Plugins
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 

Similar to Best practices in WordPress Development

Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
Paul Bearne
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
Anthony Montalbano
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
Steve Mortiboy
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
Amanda Giles
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
Evan Mullins
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcode
Rakesh Kushwaha
 
Bending word press to your will
Bending word press to your willBending word press to your will
Bending word press to your will
Tom Jenkins
 
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
 
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Damien Carbery
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
Amanda Giles
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
Zero Point Development
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Evan Mullins
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notes
Damien Carbery
 
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
Stephanie Wells
 
Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016
Ian Wilson
 
Plug in development
Plug in developmentPlug in development
Plug in development
Lucky Ali
 
Advanced Thesis Techniques and Tricks
Advanced Thesis Techniques and TricksAdvanced Thesis Techniques and Tricks
Advanced Thesis Techniques and Tricks
Brad Williams
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
John Cleveley
 
Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality
Rakesh Kushwaha
 
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Damien Carbery
 

Similar to Best practices in WordPress Development (20)

Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcode
 
Bending word press to your will
Bending word press to your willBending word press to your will
Bending word press to your will
 
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 ...
 
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notes
 
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 WordPress Hooks 2016
Introduction to WordPress Hooks 2016Introduction to WordPress Hooks 2016
Introduction to WordPress Hooks 2016
 
Plug in development
Plug in developmentPlug in development
Plug in development
 
Advanced Thesis Techniques and Tricks
Advanced Thesis Techniques and TricksAdvanced Thesis Techniques and Tricks
Advanced Thesis Techniques and Tricks
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 
Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality Overview on WordPress theme file structure and working functionality
Overview on WordPress theme file structure and working functionality
 
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
 

More from Mindfire Solutions

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
Mindfire Solutions
 
diet management app
diet management appdiet management app
diet management app
Mindfire Solutions
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
Mindfire Solutions
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
Mindfire Solutions
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
Mindfire Solutions
 
ELMAH
ELMAHELMAH
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
Mindfire Solutions
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
Mindfire Solutions
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
Mindfire Solutions
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
Mindfire Solutions
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
Mindfire Solutions
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
Mindfire Solutions
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
Mindfire Solutions
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
Mindfire Solutions
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
Mindfire Solutions
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
Mindfire Solutions
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
Mindfire Solutions
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
Mindfire Solutions
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
Mindfire Solutions
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
Mindfire Solutions
 

More from Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Recently uploaded

在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
AnkitaPandya11
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 

Recently uploaded (20)

在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 

Best practices in WordPress Development

  • 1. Best Practices in WordPress Development Presented By: Maruti Prasad Mohanty Team CMS Date: 4th September 2014
  • 2. About Me: Certifications: ● Microsoft Specialist certification in HTML5 with JavaScript and CSS3 ● Vskills WordPress Developer Stay in touch: https://www.facebook.com/maruti.mohanty https://twitter.com/maruti_mohanty mfsi_marutim marutim@mindfiresolutions.com
  • 3. Today's Agenda ● About WordPress ● Child theme ● WordPress Hooks ● Removing all warning and notices ● Use WordPress functons and libraries ● Function Naming and declaration
  • 4. Today's Agenda ● About WordPress ● Child theme ● WordPress Hooks ● Removing all warning and notices ● Use WordPress functons and libraries ● Function Naming and declaration
  • 5. About WordPress WordPress is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless at the same time. Says “WordPress.org” WordPress is the most popular CMS consisting of 23% of the total websites and 60.7% of the total CMS available. Says “w3techs.com”
  • 6. About WordPress List of some popular people, companies using Wordpress: ● Google Ventures ● Sony Music ● The New York Times ● Time ● BBC America ● Tech Crunch ● VanHeusen ● Ebay (Blog) ● Mozilla (Blog) ● Rackspace (Blog) ● Ford ● Justin Timberlake ● Justin Bieber ● Usain Bolt
  • 7. Child Theme A child theme is a theme that inherits the functionality of another theme, called the parent theme. Child themes allow you to modify, or add to the functionality of that parent theme. A child theme is the best, safest, and easiest way to modify an existing theme, whether you want to make a few tiny changes or extensive changes. Instead of modifying the theme files directly, you can create a child theme and override within.
  • 8. Child Theme How to Create a Child Theme: In the child theme directory, create a file called style.css. This is the only file required to make a child theme. The style sheet must start with the following lines: /** * Theme Name: Twenty Fourteen Child * Description: Twenty Fourteen Child Theme * Template: twentyfourteen */ @import url("../twentyfourteen/style.css"); /** * Theme Name: Twenty Fourteen Child * Description: Twenty Fourteen Child Theme * Template: twentyfourteen */ @import url("../twentyfourteen/style.css");
  • 9. Child Theme Template Files: functions.php Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.) You can directly override other template files like header.php, footer.php, single.php, or page.php etc.
  • 10. WordPress Hooks WordPress hooks are, essentially, triggers of sorts that allow users to, with short snippets of code, modify areas a WordPress theme or plugin, or add their own code to various parts of WordPress without modifying the original files. Hooks can be divided into “Action” and “Filter” hooks, the former allowing for insertion of custom code at various points and the latter allowing for the manipulation of various bits of content.
  • 11. WordPress Hooks Action: do_action( 'before_signup_form' ); add_action( 'before_signup_form', 'my_function' ); function my_function() { do_action( 'before_signup_form' ); add_action( 'before_signup_form', 'my_function' ); function my_function() { // // Codes Codes goes goes here here } } Filter: apply_filters( 'excerpt_length', 55 ); add_filter( 'excerpt_length', 'my_function' ); Function my_function() { apply_filters( 'excerpt_length', 55 ); add_filter( 'excerpt_length', 'my_function' ); Function my_function() { // Codes goes here } // Codes goes here }
  • 12. Remove All Warning and Notices One of the most important files in your WordPress installation is the wp-config.php file. This file is located in the root of your WordPress file directory and contains your website's base configuration details, such as database connection information define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', false ); define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', false ); WP_DEBUG to true also raises the error reporting level to E_ALL and activates warnings when deprecated functions or files are used;
  • 13. Use WordPress Functions and Libraries Always check if whatever you're trying to do is possible to do it with WordPress core functions and libraries. That way, your scripts will be less prone to vulnerabilities and if some appears, they will be fixed by the WordPress core contributors and you won't have to worry to contact all of your clients. add_add_image_image_size() size() instead instead of of Tim Tim Thumb Thumb library library wp_wp_remote_remote_get() get() and and wp_wp_remote_remote_post() post() instead instead of of cURL cURL get_get_template_template_part() part() instead instead of of require() require() or or include() include()
  • 14. Function Naming and Declaration Name collisions occur when a function has the same name as a function that's already been defined. For example, if in your theme you have a function called get_the_post_terms() and you install a plugin that have a function with the same name you will get something like: Fatal error: Cannot redeclare get_the_post_terms() (previously Fatal error: Cannot redeclare get_the_post_terms() (previously d deecclalarreedd i nin........ So it is advisable to add unique prefixes to your function name inspired from your theme or project fufunncctitoionn m mfsfs__ggeet_t_ththee__ppoosst_t_teterrmmss(())
  • 15. Function Naming and Declaration Use function_exists() function_exists approach allows for a child theme to override the function definition by simply defining the function themselves. Since child theme's functions.php files load first, then they will define the function first and the parent's definition will not get loaded. If ( ! function_exists( 'my_function' ) ) { If ( ! function_exists( 'my_function' ) ) { function my__function( ) { function my__function( ) { // Code goes here; } } // Code goes here; } }
  • 16. References ● http://code.tutsplus.com ● http://code.tutsplus.com/articles/tips-for-best-practices-in-wordpress-development-- cms-20649 ● https://wordpress.org