SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
Anthony Montalbano
 
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 Development
phamvanvung
 

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

Similaire à Creating WordPress Theme Faster, Smarter & Without Swearing

WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
Yoav Farhi
 

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

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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 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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
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...
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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