SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Getting started with WordPress development: 
Tricks to help you code 
By Steve Mortiboy, Semper Fi Web Design
Getting Started 
Local development vs Server-based development 
Plugin development vs Theme development 
semperfiwebdesign.com
Local Development 
MAMP / WAMP 
http://www.mamp.info/en/ 
http://www.wampserver.com/en/ 
semperfiwebdesign.com
Server-based Development 
http://codex.wordpress.org/Hosting_WordPress 
Cheap Shared Hosting 
LAMP (Linux, Apache, MySQL, PHP) 
cPanel 
Development domain 
semperfiwebdesign.com
cPanel 
Set up a sub-domain 
Set up a database 
Make sure you have your FTP login 
semperfiwebdesign.com
Other Tools 
FTP Client Software: 
http://codex.wordpress.org/FTP_Clients 
Cyberduck 
Filezilla 
Interarchy* 
Transmit* 
Plain Text Editor: 
http://codex.wordpress.org/Glossary#Text_editor 
Notepad++ 
Sublime Text 
TextMate* 
semperfiwebdesign.com
WordPress File Structure 
DO NOT TOUCH 
/wp-admin/ 
/wp-includes/ 
Plugins, Themes & Uploads 
/wp-content/ 
/wp-content/plugins/ 
/wp-content/themes/ 
/wp-content/uploads/ 
semperfiwebdesign.com
Creating a Child Theme 
Parent / Child theme structure 
Parent: /wp-content/themes/responsive/ 
Child: /wp-content/themes/steve-theme/ 
Pick a good parent theme 
https://wordpress.org/themes/ 
https://wordpress.org/themes/twentytwelve 
https://wordpress.org/themes/twentythirteen 
https://wordpress.org/themes/responsive 
Only edit the child theme 
semperfiwebdesign.com
Creating a Child Theme 
http://codex.wordpress.org/Child_Themes 
style.css 
semperfiwebdesign.com
CSS Help and Tools 
http://codex.wordpress.org/CSS 
Help 
http://www.w3schools.com/cssref/ 
http://css-tricks.com/almanac/ 
Tools 
http://getfirebug.com/ 
https://developer.chrome.com/devtools 
https://developer.mozilla.org/en-US/docs/Tools/Style_Editor 
semperfiwebdesign.com
Responsive CSS 
semperfiwebdesign.com
Responsive CSS Tools 
Chrome Developer Tools: 
https://developer.chrome.com/devtools/docs/device-mode 
Firefox Developer Tools: 
https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_View 
semperfiwebdesign.com
Theme Page Templates 
http://codex.wordpress.org/Stepping_Into_Templates 
semperfiwebdesign.com
Template Hierarchy 
http://codex.wordpress.org/Template_Hierarchy 
semperfiwebdesign.com
Parent Theme Fallback 
If a template is called and it’s not in the child theme, 
WordPress will check to see if the template exists 
in the parent theme 
Example: 
1. The template page.php is called 
2. If page.php is present in the child theme then that template is used 
3. If page.php is not present in the child theme but is present in the parent theme then that 
semperfiwebdesign.com 
template is used 
4. If page.php is not present in either child or parent theme, then the index.php template in 
the child theme is used 
5. If index.php is not present in the child theme but is present in the parent theme then that 
template is used
Which template is this? 
The body class method: 
http://codex.wordpress.org/Function_Reference/body_class 
<body <?php body_class( $class ); ?>> 
<body class="home page page-id-2 page-template-default"> 
The Debug Bar / Debug Bar Extender method: 
https://wordpress.org/plugins/debug-bar/ 
https://wordpress.org/plugins/debug-bar-extender/ 
semperfiwebdesign.com
The Loop 
http://codex.wordpress.org/The_Loop 
"The Loop" is the main process of WordPress. 
You use The Loop in your template files to display 
posts to visitors. 
The Loop processes each post to be displayed on 
the current page, and formats it according to how 
it matches specified criteria within The Loop tags. 
semperfiwebdesign.com
The Loop 
http://codex.wordpress.org/The_Loop_in_Action 
semperfiwebdesign.com 
if (have_posts()) : 
while (have_posts()) : 
the_post(); 
the_content(); 
endwhile; 
endif; 
1. have_posts() checks whether any posts 
were discovered 
2. A while loop is started and continues as 
long as have_posts() returns true 
3. the_post() takes the current item in the 
collection of posts and makes it available 
for use inside The Loop 
4. the_content() template tag fetches the 
content of the post, filters it, and then 
displays it 
5. endwhile ends the while loop 
6. endif ends the check for posts
The Loop 
Some code must be placed outside the loop 
Some code must be placed inside the loop 
Example: 
the_title(); displays the title of the post, 
to do this it must run inside the loop 
http://codex.wordpress.org/Function_Reference/the_title 
semperfiwebdesign.com
Template Tags 
http://codex.wordpress.org/Template_Tags 
Template tags are used within theme template files 
Template tags instruct WordPress to do something 
Example: 
the_date(); displays the date of the post 
This template tag accepts parameters such as 
$format – the format of the date 
$before – text to display before the date 
$after – text to display after the date 
http://codex.wordpress.org/Function_Reference/the_date 
semperfiwebdesign.com
Theme Functions 
http://codex.wordpress.org/Functions_File_Explained 
The functions file behaves like a WordPress Plugin, 
adding features and functionality to a WordPress 
site. 
You can use it to call existing functions, and to 
define your own functions. 
The functions file in a child theme can augment or 
replace the parent theme’s functions file. 
semperfiwebdesign.com
WordPress API - Actions 
http://codex.wordpress.org/Plugin_API/Action_Reference 
Actions are triggered by specific events that take place in WordPress, such as 
publishing a post, changing themes, or displaying an administration screen. An 
Action is a custom PHP function defined in your plugin or them) and hooked, i.e. set 
to respond, to some of these events. 
The basic steps to make this happen are: 
1. Create a PHP function that should execute when a specific WordPress event occurs 
2. Hook this function to the event by using the add_action() function 
3. Put your PHP function in a plugin file or your theme functions file 
semperfiwebdesign.com
WordPress API - Filters 
http://codex.wordpress.org/Plugin_API/Filter_Reference 
Filters are functions that WordPress passes data through, just before taking some 
action with the data (such as adding it to the database or sending it to the browser). 
Filters sit between the database and the browser, and between the browser and the 
database. Most input and output in WordPress passes through at least one filter. 
The basic steps to make this happen are: 
1. Create the PHP function that filters the data 
2. Hook to the filter in WordPress, by calling add_filter() 
3. Put your PHP function in a plugin file or your theme functions file 
semperfiwebdesign.com
Conditional Tags 
http://codex.wordpress.org/Conditional_Tags 
Conditional Tags can be used in your theme template 
files to change what is displayed on a particular page 
depending on whether the condition matches. 
Example: 
This code will output the Site Title in an H1 on the front page 
<?php if ( is_front_page() ) { ?> 
<h1><?php bloginfo('name'); ?></h1> 
<?php } else { 
//display something else 
} ?> 
semperfiwebdesign.com
Debugging in WordPress 
http://codex.wordpress.org/Debugging_in_WordPress 
WP_DEBUG 
define('WP_DEBUG', true); 
WP_DEBUG_LOG 
define('WP_DEBUG_LOG', true); 
Logs to /wp-content/debug.log 
WP_DEBUG_DISPLAY 
define('WP_DEBUG_DISPLAY', false); 
semperfiwebdesign.com
Plugins for Debugging 
Debug Bar: 
https://wordpress.org/plugins/debug-bar/ 
Debug Bar Extender: 
https://wordpress.org/plugins/debug-bar-extender/ 
Query Monitor: 
https://wordpress.org/plugins/query-monitor/ 
semperfiwebdesign.com
Oh No! Fatal Error 
http://codex.wordpress.org/Common_WordPress_Errors#Specific_Error_Messages 
Fatal error: Call to undefined function my_function() in 
/home/mysite/public_html/wp-content/themes/mytheme/functions.php 
on line 12 
Fatal error: Cannot redeclare post_meta_function() (previously 
declared in /home/mysite/public_html/wp-content/ 
themes/responsive/functions.php:114) in 
/home/mysite/public_html/wp-content/themes/mytheme/functions.php 
on line 26 
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to 
allocate 17472 bytes) in /home/mysite/public_html/wp-content/ 
plugins/myplugin/class.php on line 198 
semperfiwebdesign.com
The White Screen of Death 
http://codex.wordpress.org/Common_WordPress_Errors#The_White_Screen_of_Death 
1. Don’t panic 
2. Disable all plugins 
3. Deactivate your theme 
4. Enable WP_DEBUG and WP_DEBUG_LOG 
5. Check the log files 
6. Ask for help 
semperfiwebdesign.com
Creating a Theme 
http://codex.wordpress.org/Theme_Development 
Use a good starter theme 
(Twenty Twelve / Twenty Thirteen) 
Adapt code, don’t start from scratch 
Obey the coding standards 
https://make.wordpress.org/core/handbook/coding-standards/ 
Use the WordPress testing tools 
http://codex.wordpress.org/Theme_Development#Theme_Testing_Process 
semperfiwebdesign.com
Creating a Plugin 
http://codex.wordpress.org/Writing_a_Plugin 
Start small 
https://wordpress.org/plugins/hello-dolly/ 
Get to know the API 
https://developer.wordpress.org/reference/ 
Obey the coding standards 
https://make.wordpress.org/core/handbook/coding-standards/ 
Use unique function names 
function steve_function_name() 
Ask for help! 
https://wordpress.org/support/ 
semperfiwebdesign.com
Developer Resources 
https://wordpress.org/support/ 
https://codex.wordpress.org/ 
http://codex.wordpress.org/Developer_Documentation 
https://developer.wordpress.org/reference/ 
https://make.wordpress.org/ 
https://developer.wordpress.org/ 
http://wordpress.tv/ 
http://stackoverflow.com/ 
https://google.com/ 
semperfiwebdesign.com
• Support 
• Security 
• Performance 
• Development 
• Design 
• SEO

Weitere ähnliche Inhalte

Was ist angesagt?

Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themes
henri_makembe
 
Week 11 - Hosting and Migration
Week 11 - Hosting and MigrationWeek 11 - Hosting and Migration
Week 11 - Hosting and Migration
henri_makembe
 
Week 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgetsWeek 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgets
henri_makembe
 

Was ist angesagt? (20)

Week 9 - Introduction to Child Themes
Week 9  - Introduction to Child ThemesWeek 9  - Introduction to Child Themes
Week 9 - Introduction to Child Themes
 
Week 11 - Hosting and Migration
Week 11 - Hosting and MigrationWeek 11 - Hosting and Migration
Week 11 - Hosting and Migration
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
WordPress plugin development
WordPress plugin developmentWordPress plugin development
WordPress plugin development
 
Week 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgetsWeek 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgets
 
8 Ways to Hack a WordPress website
8 Ways to Hack a WordPress website8 Ways to Hack a WordPress website
8 Ways to Hack a WordPress website
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
Why it's dangerous to turn off automatic updates and here's how to do it
Why it's dangerous to turn off automatic updates and here's how to do itWhy it's dangerous to turn off automatic updates and here's how to do it
Why it's dangerous to turn off automatic updates and here's how to do it
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin Development
 
CSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsCSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the Guts
 
Rapid application development for WordPress using AWF
Rapid application development for WordPress using AWFRapid application development for WordPress using AWF
Rapid application development for WordPress using AWF
 
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
 
Cross CMS plugin development using AWF
Cross CMS plugin development using AWFCross CMS plugin development using AWF
Cross CMS plugin development using AWF
 
Secure All The Things!
Secure All The Things!Secure All The Things!
Secure All The Things!
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Higher Order WordPress Security
Higher Order WordPress SecurityHigher Order WordPress Security
Higher Order WordPress Security
 
WordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPressWordCamp SF 2011: Debugging in WordPress
WordCamp SF 2011: Debugging in WordPress
 
20 tips to Improving Your WordPress Site...for Beginners
20 tips to Improving Your WordPress Site...for Beginners20 tips to Improving Your WordPress Site...for Beginners
20 tips to Improving Your WordPress Site...for Beginners
 
WordPress Security & Backup
WordPress Security & Backup WordPress Security & Backup
WordPress Security & Backup
 

Ähnlich wie Getting started with WordPress development

Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
Anthony Montalbano
 
Plug in development
Plug in developmentPlug in development
Plug in development
Lucky Ali
 
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
 

Ähnlich wie Getting started with WordPress development (20)

Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
Introduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin DevelopmentIntroduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin Development
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 
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 ...
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
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
 
Plug in development
Plug in developmentPlug in development
Plug in development
 
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
 
How to Create a Custom WordPress Plugin
How to Create a Custom WordPress PluginHow to Create a Custom WordPress Plugin
How to Create a Custom WordPress Plugin
 
Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017
 
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
 
Bending word press to your will
Bending word press to your willBending word press to your will
Bending word press to your will
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
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
 
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
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
 
WordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopWordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute Workshop
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 

Mehr von Steve Mortiboy

Mehr von Steve Mortiboy (10)

Successfully Implementing Open Graph
Successfully Implementing Open GraphSuccessfully Implementing Open Graph
Successfully Implementing Open Graph
 
Optimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEOOptimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEO
 
Understanding SEO in 2018 by Steve Mortiboy
Understanding SEO in 2018 by Steve MortiboyUnderstanding SEO in 2018 by Steve Mortiboy
Understanding SEO in 2018 by Steve Mortiboy
 
Local SEO - Getting your local business on google
Local SEO - Getting your local business on googleLocal SEO - Getting your local business on google
Local SEO - Getting your local business on google
 
Fixing common problems with SEO by Steve Mortiboy
Fixing common problems with SEO by Steve MortiboyFixing common problems with SEO by Steve Mortiboy
Fixing common problems with SEO by Steve Mortiboy
 
Debugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve MortiboyDebugging common errors in WordPress by Steve Mortiboy
Debugging common errors in WordPress by Steve Mortiboy
 
SEO for Business Owners by Steve Mortiboy
SEO for Business Owners by Steve MortiboySEO for Business Owners by Steve Mortiboy
SEO for Business Owners by Steve Mortiboy
 
Successfully implementing open graph by steve mortiboy
Successfully implementing open graph by steve mortiboySuccessfully implementing open graph by steve mortiboy
Successfully implementing open graph by steve mortiboy
 
WordPress e-Commerce by Steve Mortiboy
WordPress e-Commerce by Steve MortiboyWordPress e-Commerce by Steve Mortiboy
WordPress e-Commerce by Steve Mortiboy
 
WordPress SEO for Content Authors
WordPress SEO for Content AuthorsWordPress SEO for Content Authors
WordPress SEO for Content Authors
 

Kürzlich hochgeladen

Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
sexy call girls service in goa
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Sheetaleventcompany
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 

Kürzlich hochgeladen (20)

Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 

Getting started with WordPress development

  • 1. Getting started with WordPress development: Tricks to help you code By Steve Mortiboy, Semper Fi Web Design
  • 2. Getting Started Local development vs Server-based development Plugin development vs Theme development semperfiwebdesign.com
  • 3. Local Development MAMP / WAMP http://www.mamp.info/en/ http://www.wampserver.com/en/ semperfiwebdesign.com
  • 4. Server-based Development http://codex.wordpress.org/Hosting_WordPress Cheap Shared Hosting LAMP (Linux, Apache, MySQL, PHP) cPanel Development domain semperfiwebdesign.com
  • 5. cPanel Set up a sub-domain Set up a database Make sure you have your FTP login semperfiwebdesign.com
  • 6. Other Tools FTP Client Software: http://codex.wordpress.org/FTP_Clients Cyberduck Filezilla Interarchy* Transmit* Plain Text Editor: http://codex.wordpress.org/Glossary#Text_editor Notepad++ Sublime Text TextMate* semperfiwebdesign.com
  • 7. WordPress File Structure DO NOT TOUCH /wp-admin/ /wp-includes/ Plugins, Themes & Uploads /wp-content/ /wp-content/plugins/ /wp-content/themes/ /wp-content/uploads/ semperfiwebdesign.com
  • 8. Creating a Child Theme Parent / Child theme structure Parent: /wp-content/themes/responsive/ Child: /wp-content/themes/steve-theme/ Pick a good parent theme https://wordpress.org/themes/ https://wordpress.org/themes/twentytwelve https://wordpress.org/themes/twentythirteen https://wordpress.org/themes/responsive Only edit the child theme semperfiwebdesign.com
  • 9. Creating a Child Theme http://codex.wordpress.org/Child_Themes style.css semperfiwebdesign.com
  • 10. CSS Help and Tools http://codex.wordpress.org/CSS Help http://www.w3schools.com/cssref/ http://css-tricks.com/almanac/ Tools http://getfirebug.com/ https://developer.chrome.com/devtools https://developer.mozilla.org/en-US/docs/Tools/Style_Editor semperfiwebdesign.com
  • 12. Responsive CSS Tools Chrome Developer Tools: https://developer.chrome.com/devtools/docs/device-mode Firefox Developer Tools: https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_View semperfiwebdesign.com
  • 13. Theme Page Templates http://codex.wordpress.org/Stepping_Into_Templates semperfiwebdesign.com
  • 15. Parent Theme Fallback If a template is called and it’s not in the child theme, WordPress will check to see if the template exists in the parent theme Example: 1. The template page.php is called 2. If page.php is present in the child theme then that template is used 3. If page.php is not present in the child theme but is present in the parent theme then that semperfiwebdesign.com template is used 4. If page.php is not present in either child or parent theme, then the index.php template in the child theme is used 5. If index.php is not present in the child theme but is present in the parent theme then that template is used
  • 16. Which template is this? The body class method: http://codex.wordpress.org/Function_Reference/body_class <body <?php body_class( $class ); ?>> <body class="home page page-id-2 page-template-default"> The Debug Bar / Debug Bar Extender method: https://wordpress.org/plugins/debug-bar/ https://wordpress.org/plugins/debug-bar-extender/ semperfiwebdesign.com
  • 17. The Loop http://codex.wordpress.org/The_Loop "The Loop" is the main process of WordPress. You use The Loop in your template files to display posts to visitors. The Loop processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. semperfiwebdesign.com
  • 18. The Loop http://codex.wordpress.org/The_Loop_in_Action semperfiwebdesign.com if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile; endif; 1. have_posts() checks whether any posts were discovered 2. A while loop is started and continues as long as have_posts() returns true 3. the_post() takes the current item in the collection of posts and makes it available for use inside The Loop 4. the_content() template tag fetches the content of the post, filters it, and then displays it 5. endwhile ends the while loop 6. endif ends the check for posts
  • 19. The Loop Some code must be placed outside the loop Some code must be placed inside the loop Example: the_title(); displays the title of the post, to do this it must run inside the loop http://codex.wordpress.org/Function_Reference/the_title semperfiwebdesign.com
  • 20. Template Tags http://codex.wordpress.org/Template_Tags Template tags are used within theme template files Template tags instruct WordPress to do something Example: the_date(); displays the date of the post This template tag accepts parameters such as $format – the format of the date $before – text to display before the date $after – text to display after the date http://codex.wordpress.org/Function_Reference/the_date semperfiwebdesign.com
  • 21. Theme Functions http://codex.wordpress.org/Functions_File_Explained The functions file behaves like a WordPress Plugin, adding features and functionality to a WordPress site. You can use it to call existing functions, and to define your own functions. The functions file in a child theme can augment or replace the parent theme’s functions file. semperfiwebdesign.com
  • 22. WordPress API - Actions http://codex.wordpress.org/Plugin_API/Action_Reference Actions are triggered by specific events that take place in WordPress, such as publishing a post, changing themes, or displaying an administration screen. An Action is a custom PHP function defined in your plugin or them) and hooked, i.e. set to respond, to some of these events. The basic steps to make this happen are: 1. Create a PHP function that should execute when a specific WordPress event occurs 2. Hook this function to the event by using the add_action() function 3. Put your PHP function in a plugin file or your theme functions file semperfiwebdesign.com
  • 23. WordPress API - Filters http://codex.wordpress.org/Plugin_API/Filter_Reference Filters are functions that WordPress passes data through, just before taking some action with the data (such as adding it to the database or sending it to the browser). Filters sit between the database and the browser, and between the browser and the database. Most input and output in WordPress passes through at least one filter. The basic steps to make this happen are: 1. Create the PHP function that filters the data 2. Hook to the filter in WordPress, by calling add_filter() 3. Put your PHP function in a plugin file or your theme functions file semperfiwebdesign.com
  • 24. Conditional Tags http://codex.wordpress.org/Conditional_Tags Conditional Tags can be used in your theme template files to change what is displayed on a particular page depending on whether the condition matches. Example: This code will output the Site Title in an H1 on the front page <?php if ( is_front_page() ) { ?> <h1><?php bloginfo('name'); ?></h1> <?php } else { //display something else } ?> semperfiwebdesign.com
  • 25. Debugging in WordPress http://codex.wordpress.org/Debugging_in_WordPress WP_DEBUG define('WP_DEBUG', true); WP_DEBUG_LOG define('WP_DEBUG_LOG', true); Logs to /wp-content/debug.log WP_DEBUG_DISPLAY define('WP_DEBUG_DISPLAY', false); semperfiwebdesign.com
  • 26. Plugins for Debugging Debug Bar: https://wordpress.org/plugins/debug-bar/ Debug Bar Extender: https://wordpress.org/plugins/debug-bar-extender/ Query Monitor: https://wordpress.org/plugins/query-monitor/ semperfiwebdesign.com
  • 27. Oh No! Fatal Error http://codex.wordpress.org/Common_WordPress_Errors#Specific_Error_Messages Fatal error: Call to undefined function my_function() in /home/mysite/public_html/wp-content/themes/mytheme/functions.php on line 12 Fatal error: Cannot redeclare post_meta_function() (previously declared in /home/mysite/public_html/wp-content/ themes/responsive/functions.php:114) in /home/mysite/public_html/wp-content/themes/mytheme/functions.php on line 26 Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 17472 bytes) in /home/mysite/public_html/wp-content/ plugins/myplugin/class.php on line 198 semperfiwebdesign.com
  • 28. The White Screen of Death http://codex.wordpress.org/Common_WordPress_Errors#The_White_Screen_of_Death 1. Don’t panic 2. Disable all plugins 3. Deactivate your theme 4. Enable WP_DEBUG and WP_DEBUG_LOG 5. Check the log files 6. Ask for help semperfiwebdesign.com
  • 29. Creating a Theme http://codex.wordpress.org/Theme_Development Use a good starter theme (Twenty Twelve / Twenty Thirteen) Adapt code, don’t start from scratch Obey the coding standards https://make.wordpress.org/core/handbook/coding-standards/ Use the WordPress testing tools http://codex.wordpress.org/Theme_Development#Theme_Testing_Process semperfiwebdesign.com
  • 30. Creating a Plugin http://codex.wordpress.org/Writing_a_Plugin Start small https://wordpress.org/plugins/hello-dolly/ Get to know the API https://developer.wordpress.org/reference/ Obey the coding standards https://make.wordpress.org/core/handbook/coding-standards/ Use unique function names function steve_function_name() Ask for help! https://wordpress.org/support/ semperfiwebdesign.com
  • 31. Developer Resources https://wordpress.org/support/ https://codex.wordpress.org/ http://codex.wordpress.org/Developer_Documentation https://developer.wordpress.org/reference/ https://make.wordpress.org/ https://developer.wordpress.org/ http://wordpress.tv/ http://stackoverflow.com/ https://google.com/ semperfiwebdesign.com
  • 32.
  • 33. • Support • Security • Performance • Development • Design • SEO