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
 
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
 
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
 
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
 
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
 
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

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 

Kürzlich hochgeladen (20)

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 

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