SlideShare ist ein Scribd-Unternehmen logo
1 von 47
HOW TO MAKE WORDPRESS
THEMES FASTER, SMARTER &
   WITHOUT SWEARING
        MARCIN WOLAK
START
CLIENT
GRAPHIC
HTML CODER
WP DEVELOPER
GRAPHIC
     +
   CODER
     +
WP DEVELOPER
GRAPHIC
     Δ
   CODER
    Δ
WP DEVELOPER
WP START
HOW MANY FILES
  YOU NEED?
THE SIMPLEST THEME
 INCLUDES ONLY
A STYLE.CSS FILE,
 PLUS IMAGES, IF ANY.
      (WORDPRESS CODEX)
THE SIMPLEST THEME POSSIBLE IS A

          CHILD THEME
                          WHICH

INCLUDES ONLY A STYLE.CSS FILE,
       PLUS ANY IMAGES. THIS IS POSSIBLE BECAUSE IT IS
A CHILD OF ANOTHER THEME WHICH ACTS AS
              ITS PARENT.
              (WORDPRESS CODEX - CURRENT)
HOW MANY FILES
  YOU NEED?
STYLE.CSS
INDEX.PHP
TEMPLATE HIERARCHY
CHILD THEME
‱   /WP-CONTENT/THEMES/
‱   WP-ADMIN
‱   STYLE.CSS*
‱   FUNCTIONS.PHP + OTHER TEMPLATE FILES
‱   FOLDERS WITH MEDIA, JS, CSS ETC.
STYLE.CSS
1:    /*
2:    Theme Name: Child Theme Name
3:    Theme URI: Child Theme URI
4:    Description: Our description of theme
5:    Author: Authors name
6:    Author URI: Authors website
7:    Template: twentyeleven
8:    Version: 1.0
10:   General comments/License Statement if any.
11:   */
STYLE.CSS
1:    /*
2:    Theme Name: Child Theme Name
3:    Theme URI: Child Theme URI
4:    Description: Our description of theme
5:    Author: Authors name
6:    Author URI: Authors website
7:    Template: twentyeleven
8:    Version: 1.0
10:   General comments/License Statement if any.
11:   */
STYLE.CSS
1:    /*
2:    Theme Name: Child Theme Name
3:    Theme URI: Child Theme URI
4:    Description: Our description of theme
5:    Author: Authors name
6:    Author URI: Authors website
7:    Template: thematic
8:    Version: 1.0
10:   General comments/License Statement if any.
11:   */
12:
13:   @import url(‘../thematic/style.css’);
STYLE.CSS
1:    /*
2:    Theme Name: Child Theme Name
3:    Theme URI: Child Theme URI
4:    Description: Our description of theme
5:    Author: Authors name
6:    Author URI: Authors website
7:    Template: thematic
8:    Version: 1.0
10:   General comments/License Statement if any.
11:   */
12:
13:   @import url(‘../thematic/style.css’);
14
15:   body { background-color: cyan; }
FUNCTIONS.PHP
                           CHILD

1: <?php
2:     function theme_special_nav() {
3:            // Do something.
4:     }
5: ?>
FUNCTIONS.PHP
                          PARENT

1: <?php
2:     if (!function_exists('theme_special_nav')) {
3:            function theme_special_nav() {
4:                   // Do something.
5:            }
6:     }
7: ?>
RTL.CSS   TAG.PHP
              INDEX.PHP    TAXONOMY.PHP
         COMMENTS.PHP      AUTHOR.PHP
        FRONT-PAGE.PHP     DATE.PHP
               HOME.PHP    ARCHIVE.PHP
             SINGLE.PHP    SEARCH.PHP
SINGLE-<POST-TYPE>.PHP     ATTACHMENT.PHP
               PAGE.PHP    IMAGE.PHP
          CATEGORY.PHP     404.PHP
MODULES
STYLE.CSS
FUNCTIONS.PHP
1: <?php
2:
3: function childtheme_create_stylesheet() {
4:        $templatedir = get_bloginfo('template_directory'); //parent folder
5:        $stylesheetdir = get_bloginfo('stylesheet_directory'); //child folder
6: ?>
7:        <link rel="stylesheet" type="text/css" href="<?php echo $templatedir
?>/library/styles/reset.css" />
8:        <link rel="stylesheet" type="text/css" href="<?php echo $templatedir
?>/library/styles/typography.css" />



20:   <?php
21:   }
22:   add_filter('thematic_create_stylesheet', 'childtheme_create_stylesheet');
23:   ?>
FUNCTIONS.PHP
1: <?php
2:       /** register with hook 'wp_print_styles' */
3:       add_action('wp_print_styles', 'add_my_stylesheet');
4:
5:       /* * Enqueue style-file, if it exists. */
6:       function add_my_stylesheet() {
7:                 //Parent theme style
8:                 $parentStyleUrl = get_template_directory_uri().‘/style.css’;
9:                 if ( file_exists($myStyleFile) ) {
10:                          wp_register_style(‘parentStyleUrl', $parentStyleUrl );
11:                          wp_enqueue_style(‘parentStyleUrl');
12:                }
13:                //Child theme style
14:                $childStyleUrl = get_stylesheet_directory_uri().‘/style.css’;
15:                if ( file_exists($ childStyleUrl ) ) {
16:                          wp_register_style('childStyleUrl', $childStyleUrl );
17:                          wp_enqueue_style( ‘childStyleUrl');
18:                }
19:      }
20: ?>
WP MINIFY
CSS: WP_ENQUEUE_STYLE
JS: WP_ENQUEUE_SCRIPT
WHEN IS IT GOOD?
FRAMEWORK
DRY & DIE
PAGE.PHP
1:    <?php
2:    /*
3:    * Page template
4:    */
5:    get_header();
6:
7:    //Sub Menu Part
8:    get_template_part(‘submenu’);           // gets submenu.php file
9:
10:   //Standard loop for page
11:   get_template_part(‘content’, ‘page’);   // gets content-page.php file
12:
13:   //Latest News
14:   get_template_part(‘news’);              // gets news.php file
15:
16:   get_footer();
17:
18:   ?>
REMEMBER
USE TECHNOLOGY
1:
2:   <a href=‘<?php echo get_permalink(39) ?>’>
3:             <?php echo get_the_title(39) ?>
4:   </a>
5:
ABUSE TECHNOLOGY
1:
2:   <a href=‘<?php echo get_permalink(39) ?>’>
3:             <?php echo get_the_title(39) ?>
4:   </a>
5:
USE TECHNOLOGY
1: <?php
2:       get_header();                           // header.phg
3:       get_header(‘single’);                   // header-single.php
4:
5:       get_sidebar();                          // sidebar.php
6:       get_sidebar(‘left’);                    // sidebar-left.php
7:
8:       get_template_part( 'loop', 'index' );
9:       // wp-content/themes/child/loop-index.php
10:      // wp-content/themes/child/loop.php
11:      // wp-content/themes/parent/loop-index.php
12:      // wp-content/themes/parent/loop.php
13:
14:      get_footer();                           // footer.php
15:      get_footer(‘category’);                 // footer-category.php
16:
17:      load_template(TEMPLATEPATH . '/template-name.php');
18:
19:      locate_template($template_names, $load);
20:
21:      include(get_query_template(‘404'));     //404.php
22:      include(get_404_template());            //404.php
23:
24: ?>
CLIENT
  ≠
CODER
WYSiWYG
WYSiWTF
THANK YOU!
     MARCIN WOLAK

  WWW.MARCINWOLAK.PL
KONTAKT@MARCINWOLAK.PL

Weitere Àhnliche Inhalte

Was ist angesagt?

D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - LondonMarek Sotak
 
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Peter Martin
 
Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Peter Martin
 
WordCamp Finland 2015 - WordPress Security
WordCamp Finland 2015 - WordPress SecurityWordCamp Finland 2015 - WordPress Security
WordCamp Finland 2015 - WordPress SecurityTiia Rantanen
 
Rapid application development with FOF
Rapid application development with FOFRapid application development with FOF
Rapid application development with FOFNicholas Dionysopoulos
 
Essential html tweaks for accessible themes
Essential html tweaks for accessible themesEssential html tweaks for accessible themes
Essential html tweaks for accessible themesMartin Stehle
 
Html5 oslo-code-camp
Html5 oslo-code-campHtml5 oslo-code-camp
Html5 oslo-code-campbrucelawson
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress pluginAnthony Montalbano
 
Introduction to Using PHP & MVC Frameworks
Introduction to Using PHP & MVC FrameworksIntroduction to Using PHP & MVC Frameworks
Introduction to Using PHP & MVC FrameworksGerald Krishnan
 
Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!Hans Kuijpers
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPressNile Flores
 
FLOW3, Extbase & Fluid cook book
FLOW3, Extbase & Fluid cook bookFLOW3, Extbase & Fluid cook book
FLOW3, Extbase & Fluid cook bookBastian Waidelich
 
Wordpress development: A Modern Approach
Wordpress development:  A Modern ApproachWordpress development:  A Modern Approach
Wordpress development: A Modern ApproachAlessandro Fiore
 
Word Camp Fukuoka2010
Word Camp Fukuoka2010Word Camp Fukuoka2010
Word Camp Fukuoka2010YUKI YAMAGUCHI
 
Develop advance joomla! MVC Component for version 3
Develop advance joomla! MVC Component for version 3Develop advance joomla! MVC Component for version 3
Develop advance joomla! MVC Component for version 3Gunjan Patel
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
Web-Performance
Web-PerformanceWeb-Performance
Web-PerformanceWalter Ebert
 
Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Maurizio Pelizzone
 
Firefox Extension Development
Firefox Extension DevelopmentFirefox Extension Development
Firefox Extension Developmentphamvanvung
 

Was ist angesagt? (20)

D7 theming what's new - London
D7 theming what's new - LondonD7 theming what's new - London
D7 theming what's new - London
 
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
 
Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016Developing new feature in Joomla - Joomladay UK 2016
Developing new feature in Joomla - Joomladay UK 2016
 
WordCamp Finland 2015 - WordPress Security
WordCamp Finland 2015 - WordPress SecurityWordCamp Finland 2015 - WordPress Security
WordCamp Finland 2015 - WordPress Security
 
Rapid application development with FOF
Rapid application development with FOFRapid application development with FOF
Rapid application development with FOF
 
Theming 101
Theming 101Theming 101
Theming 101
 
Essential html tweaks for accessible themes
Essential html tweaks for accessible themesEssential html tweaks for accessible themes
Essential html tweaks for accessible themes
 
Html5 oslo-code-camp
Html5 oslo-code-campHtml5 oslo-code-camp
Html5 oslo-code-camp
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
Introduction to Using PHP & MVC Frameworks
Introduction to Using PHP & MVC FrameworksIntroduction to Using PHP & MVC Frameworks
Introduction to Using PHP & MVC Frameworks
 
Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
FLOW3, Extbase & Fluid cook book
FLOW3, Extbase & Fluid cook bookFLOW3, Extbase & Fluid cook book
FLOW3, Extbase & Fluid cook book
 
Wordpress development: A Modern Approach
Wordpress development:  A Modern ApproachWordpress development:  A Modern Approach
Wordpress development: A Modern Approach
 
Word Camp Fukuoka2010
Word Camp Fukuoka2010Word Camp Fukuoka2010
Word Camp Fukuoka2010
 
Develop advance joomla! MVC Component for version 3
Develop advance joomla! MVC Component for version 3Develop advance joomla! MVC Component for version 3
Develop advance joomla! MVC Component for version 3
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress
 
Firefox Extension Development
Firefox Extension DevelopmentFirefox Extension Development
Firefox Extension Development
 

Ähnlich wie Creating WordPress Theme Faster, Smarter & Without Swearing

The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Paul Bearne
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28thChris Adams
 
crtical points for customizing Joomla templates
crtical points for customizing Joomla templatescrtical points for customizing Joomla templates
crtical points for customizing Joomla templatesamit das
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4David Bisset
 
Mobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLsMobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLsHarvard Web Working Group
 
How to make a WordPress theme
How to make a WordPress themeHow to make a WordPress theme
How to make a WordPress themeHardeep Asrani
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentSitdhibong Laokok
 
RESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroRESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroChristopher Pecoraro
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sinsGeorge Stephanis
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Mike Schinkel
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1Yoav Farhi
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3David Bisset
 
Flask – Python
Flask – PythonFlask – Python
Flask – PythonMax Claus Nunes
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's CodeWildan Maulana
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateLaura Scott
 

Ähnlich wie Creating WordPress Theme Faster, Smarter & Without Swearing (20)

The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28th
 
crtical points for customizing Joomla templates
crtical points for customizing Joomla templatescrtical points for customizing Joomla templates
crtical points for customizing Joomla templates
 
WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4WordPress Theme Workshop: Part 4
WordPress Theme Workshop: Part 4
 
Mobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLsMobile themes, QR codes, and shortURLs
Mobile themes, QR codes, and shortURLs
 
How to make a WordPress theme
How to make a WordPress themeHow to make a WordPress theme
How to make a WordPress theme
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
 
RESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroRESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher Pecoraro
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
Taking your Web App for a walk
Taking your Web App for a walkTaking your Web App for a walk
Taking your Web App for a walk
 

KĂŒrzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

KĂŒrzlich hochgeladen (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Creating WordPress Theme Faster, Smarter & Without Swearing

  • 1. HOW TO MAKE WORDPRESS THEMES FASTER, SMARTER & WITHOUT SWEARING MARCIN WOLAK
  • 7. GRAPHIC + CODER + WP DEVELOPER
  • 8. GRAPHIC Δ CODER Δ WP DEVELOPER
  • 10. HOW MANY FILES YOU NEED?
  • 11. THE SIMPLEST THEME INCLUDES ONLY A STYLE.CSS FILE, PLUS IMAGES, IF ANY. (WORDPRESS CODEX)
  • 12. THE SIMPLEST THEME POSSIBLE IS A CHILD THEME WHICH INCLUDES ONLY A STYLE.CSS FILE, PLUS ANY IMAGES. THIS IS POSSIBLE BECAUSE IT IS A CHILD OF ANOTHER THEME WHICH ACTS AS ITS PARENT. (WORDPRESS CODEX - CURRENT)
  • 13. HOW MANY FILES YOU NEED?
  • 16. CHILD THEME ‱ /WP-CONTENT/THEMES/ ‱ WP-ADMIN ‱ STYLE.CSS* ‱ FUNCTIONS.PHP + OTHER TEMPLATE FILES ‱ FOLDERS WITH MEDIA, JS, CSS ETC.
  • 17. STYLE.CSS 1: /* 2: Theme Name: Child Theme Name 3: Theme URI: Child Theme URI 4: Description: Our description of theme 5: Author: Authors name 6: Author URI: Authors website 7: Template: twentyeleven 8: Version: 1.0 10: General comments/License Statement if any. 11: */
  • 18. STYLE.CSS 1: /* 2: Theme Name: Child Theme Name 3: Theme URI: Child Theme URI 4: Description: Our description of theme 5: Author: Authors name 6: Author URI: Authors website 7: Template: twentyeleven 8: Version: 1.0 10: General comments/License Statement if any. 11: */
  • 19.
  • 20.
  • 21. STYLE.CSS 1: /* 2: Theme Name: Child Theme Name 3: Theme URI: Child Theme URI 4: Description: Our description of theme 5: Author: Authors name 6: Author URI: Authors website 7: Template: thematic 8: Version: 1.0 10: General comments/License Statement if any. 11: */ 12: 13: @import url(‘../thematic/style.css’);
  • 22.
  • 23. STYLE.CSS 1: /* 2: Theme Name: Child Theme Name 3: Theme URI: Child Theme URI 4: Description: Our description of theme 5: Author: Authors name 6: Author URI: Authors website 7: Template: thematic 8: Version: 1.0 10: General comments/License Statement if any. 11: */ 12: 13: @import url(‘../thematic/style.css’); 14 15: body { background-color: cyan; }
  • 24.
  • 25. FUNCTIONS.PHP CHILD 1: <?php 2: function theme_special_nav() { 3: // Do something. 4: } 5: ?>
  • 26. FUNCTIONS.PHP PARENT 1: <?php 2: if (!function_exists('theme_special_nav')) { 3: function theme_special_nav() { 4: // Do something. 5: } 6: } 7: ?>
  • 27. RTL.CSS TAG.PHP INDEX.PHP TAXONOMY.PHP COMMENTS.PHP AUTHOR.PHP FRONT-PAGE.PHP DATE.PHP HOME.PHP ARCHIVE.PHP SINGLE.PHP SEARCH.PHP SINGLE-<POST-TYPE>.PHP ATTACHMENT.PHP PAGE.PHP IMAGE.PHP CATEGORY.PHP 404.PHP
  • 30.
  • 31.
  • 32. FUNCTIONS.PHP 1: <?php 2: 3: function childtheme_create_stylesheet() { 4: $templatedir = get_bloginfo('template_directory'); //parent folder 5: $stylesheetdir = get_bloginfo('stylesheet_directory'); //child folder 6: ?> 7: <link rel="stylesheet" type="text/css" href="<?php echo $templatedir ?>/library/styles/reset.css" /> 8: <link rel="stylesheet" type="text/css" href="<?php echo $templatedir ?>/library/styles/typography.css" /> 
 20: <?php 21: } 22: add_filter('thematic_create_stylesheet', 'childtheme_create_stylesheet'); 23: ?>
  • 33. FUNCTIONS.PHP 1: <?php 2: /** register with hook 'wp_print_styles' */ 3: add_action('wp_print_styles', 'add_my_stylesheet'); 4: 5: /* * Enqueue style-file, if it exists. */ 6: function add_my_stylesheet() { 7: //Parent theme style 8: $parentStyleUrl = get_template_directory_uri().‘/style.css’; 9: if ( file_exists($myStyleFile) ) { 10: wp_register_style(‘parentStyleUrl', $parentStyleUrl ); 11: wp_enqueue_style(‘parentStyleUrl'); 12: } 13: //Child theme style 14: $childStyleUrl = get_stylesheet_directory_uri().‘/style.css’; 15: if ( file_exists($ childStyleUrl ) ) { 16: wp_register_style('childStyleUrl', $childStyleUrl ); 17: wp_enqueue_style( ‘childStyleUrl'); 18: } 19: } 20: ?>
  • 35. WHEN IS IT GOOD?
  • 38. PAGE.PHP 1: <?php 2: /* 3: * Page template 4: */ 5: get_header(); 6: 7: //Sub Menu Part 8: get_template_part(‘submenu’); // gets submenu.php file 9: 10: //Standard loop for page 11: get_template_part(‘content’, ‘page’); // gets content-page.php file 12: 13: //Latest News 14: get_template_part(‘news’); // gets news.php file 15: 16: get_footer(); 17: 18: ?>
  • 39.
  • 41. USE TECHNOLOGY 1: 2: <a href=‘<?php echo get_permalink(39) ?>’> 3: <?php echo get_the_title(39) ?> 4: </a> 5:
  • 42. ABUSE TECHNOLOGY 1: 2: <a href=‘<?php echo get_permalink(39) ?>’> 3: <?php echo get_the_title(39) ?> 4: </a> 5:
  • 43. USE TECHNOLOGY 1: <?php 2: get_header(); // header.phg 3: get_header(‘single’); // header-single.php 4: 5: get_sidebar(); // sidebar.php 6: get_sidebar(‘left’); // sidebar-left.php 7: 8: get_template_part( 'loop', 'index' ); 9: // wp-content/themes/child/loop-index.php 10: // wp-content/themes/child/loop.php 11: // wp-content/themes/parent/loop-index.php 12: // wp-content/themes/parent/loop.php 13: 14: get_footer(); // footer.php 15: get_footer(‘category’); // footer-category.php 16: 17: load_template(TEMPLATEPATH . '/template-name.php'); 18: 19: locate_template($template_names, $load); 20: 21: include(get_query_template(‘404')); //404.php 22: include(get_404_template()); //404.php 23: 24: ?>
  • 47. THANK YOU! MARCIN WOLAK WWW.MARCINWOLAK.PL KONTAKT@MARCINWOLAK.PL