SlideShare a Scribd company logo
1 of 48
Download to read offline
WordPress: ‘under the hood’




by Peter Luit
@peterluit
Meant for.....

• WordPress users, who


  • know the admin part and how to make pages en posts


  • know how to place media elements in pages and postst


  • know how to handle categories and tags


  • know the concept of plug ins


  • know the concept of themes


  • know to use the menu system
WordPress
Part 1: the basics




by Peter Luit
Website - pages

                  meant for ‘static’ content




                             pages
Weblog - articles (posts, blogs)

                  meant for ‘dynamic’ content


                           newest




                              posts (timeline)

                            oldest
WordPress - posts/pages

            WordPress knows both types of content



                    newest



                     posts (timeline)




                                        pages
                    oldest
WordPress - menu structure (starting with 3.0)

                               1                      2    3
                                                                       - external links
                                                      2a               - posts
                                                      2b               - pages
                                                                       - categories(*)
                                                                       - tags(*)
                               newest



                                   posts (timeline)




                                                               pages
                                oldest



 * categories and tags only applicable for posts
WordPress - sidebars, extra areas

                  1                      2        3
                                                                  * depending on theme
                                         2a                       possibilities
                                         2b




                                              *
                  newest                                           *
                      posts (timeline)




                                                      pages
        *    *
                                                              *        *

                  oldest


                                              *
WordPress - widgets

                                     1                      2    3

                                                            2a

                                                            2b




                                     newest



                                         posts (timeline)




                                                                     pages
                                      oldest



- widgets are independent areas in the sidebars
- a widgets can display results of a plugin or contain static text
WordPress - header/footer

                   1                      2    3

                                          2a

                                          2b




                   newest



                       posts (timeline)




                                                   pages
                   oldest




                header en footer size/position
WordPress - plug-ins

                                                      1             2     3

added functions, for example                                        2a

contactform, social media icons,                                    2b


read article counter etc.
                                                newest




                                                 posts (timeline)
                              plugin




                                                                         pages
   plugin            plugin
            plugin
                                       plugin




                                                oldest
                 WP core
WordPress - themes

                                                    1             2     3

                                                                  2a


              theme                                               2b




                                              newest




                                               posts (timeline)
                            plugin




                                                                       pages
 plugin            plugin
          plugin
                                     plugin




                                              oldest
               WP core



- themes determine the totel user interface
- free and premium (mostly paid) versions
- very big differences in possibilities
WordPress
Part 2: architecture




by Peter Luit
WordPress - Architecture
    ‘fixed’            content    metadata

      pagina’s



                         title   comments(*)


                        body


                        media




    ‘timeline’        content    metadata
   timeline (blogs)



                         title    category     tags   comments(*)


                        body


                        media



* optional
WordPress - Menu



               menu item



                            empty (#)


                              URL


                             page(s)


                             post(s)


                           categorie(s)


                              tag(s)
WordPress - Choosing a theme


      very basic                   basic                  advanced




- no or very limited   - adjustments possible     - may adjustments and
adjustments            - variable layout          export of settings
- fixed layout          - most often for free      - in most cases paid
- limited sidebars     - internal CSS editting    themes
- mostly free          possible                   - framwork for developing
                       - export of settings file   child themes
                                                  - CSS/PHP knowledge
                                                  required
WordPress - Choosing a theme (examples)

• Free: Twenty Eleven (standard WordPress theme, sinple but fine for strating
  projects)


• Free: Atahualpa (generates chaotic HTML code, but many possibilities)


• Free: Suffusion (modern ‘block’ oriented theme, many adjustments)


• Paid: PlatformPro (custom post types in design, suitable for child themes,
  internal CSS settings possible)


• Paid: BizzFolio (business design, interbal CSS settings possible)


• Paid: Genesis (framework for developing advanced child themes)
WordPress - Frameworks

• In many cases a confusing name with two meanings

  • A - possible very advanced - parent theme, from which child themes can
    be made (mostly they supply very useful CSS documentation)

     • Genesis, Hybrid, Thematic etc.

     • Atahualpa also says to be a framework.....

  • A seperate development tool for making parent themes
    (is not a theme by itself!)

     • Hybrid Core

     • Artisteer
WordPress - parentthemes and childthemes

                                                         1             2     3



          childtheme
                                                                       2a

                                                                       2b




                                                   newest

          parenttheme




                                                    posts (timeline)




                                                                            pages
 plugin    plugin            plugin   plugin
                    plugin




                                                   oldest
                WP core



 - child theme uses base settings from the parent theme
 - updating parent theme does not influence settings in child theme
WordPress - parentthemes and childthemes
                               design(*)            functionality



        childtheme              aanvullende CSS       aanvullende PHP

                                                    examples:
                          ‘gets base from parent’   - functions.php
                          @import url("../theme/    - header.php
                          style.css");              - footer.php
                                                    etc.
                          css knowledge required
                                                    php knowledge
                                                    required




       parenttheme                 base CSS              base PHP




   * for CSS see part 7
WordPress - parent- en childthemes

• Child themes: don’t make too complex child themes


  • The main purpose: Child themes contain relatively simple personal settings
    based on changed settings/routines from the parent theme


  • The parent theme can be updated with new versions, leaving the child
    theme untouched


  • Making a child theme (too?) complex might result in errors/warnings after
    upgrading the parent theme


     • don’t make a new parent theme with a child theme......
WordPress
Part 3: hooks(*)




door Peter Luit
* also look at part 6: plugins
WordPress - hooks (actions and filters)

                                               1             2     3

                                                             2a
                   childtheme                                2b




                                         newest
                  parenttheme
      hooks




                                          posts (timeline)




                                                                  pages
                      plugins




                    WP core

                                         oldest

- ‘before’ and ‘after’ are the primary
‘locations’ of an event where/when
a hooked action/filter will be
executed
WordPress - hooks, the basics

                         add_action               where   name of function


                       function name {


                                         what to do


                              }




                                                  where



                                                            before/after header


                                                          before/after siderbar(s) #
- differs per theme
- php knowledge required                                    before after page #

- place this in functions.php in childtheme
                                                             before/after footer
WordPress - hooks, example


add_action('suffusion_before_begin_content', 'my_custom_before_page');
function my_custom_before_page() {
	   if(is_page( 'mijn-home' )) {
	   	      slidedeck( 146, array( 'width' => '100%', 'height' => '225px' ) );
	   }	
}

- suffusion_before_begin_content is a location definition in the Suffusion theme
- my_custom_before_page is the name of the routine to be made
- function defines the beginning of the new routine
- this example puts slidedeck slideshow (is a plugin) only at page ‘mijn-home’
- slidedeck( 146, array( 'width' => '100%', 'height' => '225px' ) ); is the format in which
slidedeck data must be used

- place the code above in functions.php in child theme
WordPress
Part 4: custom post types




by Peter Luit
WordPress - custom post types, example




 example within Platform Pro
 3 boxes at the homepage of luit.nl
WordPress - custom post types, at luit.nl




                                            features




                                            boxes




                                            carousel
WordPress - custom post types


           WP standard                             example

                 posts                                    events


                 pages                                    booklist


                                                    holiday destinations




   - moderne themes bouwen specifieke custom post types in (bijv. PlatformPro)
   - er zijn diverse plug-ins om custom post types interactief te kunnen maken
WordPress - custom post types, technology
                                                            execute this after WP startup

            add_action                 ‘init’             name


          function name {


                            labels              WP functions(*), including the displayname
                            display             what will the user see?
                            register            regster the function
                 }




        - place this in functions.php in child theme
        * like ‘add’, ‘edit’, ‘search’, ‘view’ ......
WordPress - custom post types, display content

             single.php          base to display single content

          maak een copy




        bijv. single-event.php   place in child theme




       look for
       <h1 class="entry-title"><?php the_title(); ?></h1>


       replace with
       <h1 class="entry-title">Event: <?php the_title(); ?></h1>
WordPress
Part 5: multisites and permalinks




by Peter Luit
WordPress - multisites network

   one website        via subdirectories          via subdomains




 http://www.name.nl      http://www.naam.nl
                           http://www.naam.nl
                                                   http://www.naam.nl
                                                     http://www.naam.nl
                          http://www.name.nl/
                             http://www.naam.nl        http://www.naam.nl
                                                   http://subsite1.name.nl
                               subsite1




                      - own look&feel
                      - own menu
                      - own content
WordPress - multisites network, settings



                                 wp-config.php        adjust

                                   .htaccess         make/adjust
     http://www.naam.nl
       http://www.naam.nl
      http://www.name.nl/
         http://www.naam.nl
           subsite1
                                  httpd config        adjust (server dependend)

                                  permalinks         adjust

                              wp-content/blogs.dir   make
WordPress - multisites network, settings

                                                        wp-config.php            adjust

       http://www.naam.nl
         http://www.naam.nl
        http://www.naam.nl/
           http://www.naam.nl
                 subsite1




    define('WP_ALLOW_MULTISITE', true); -- plaats dit net voor /* That's all, stop editing! Happy blogging. */:



    login agian, add the following after the line you just inserted in config.php:

    define(   'MULTISITE', true );
    define(   'SUBDOMAIN_INSTALL', false );
    $base =   '/';
    define(   'DOMAIN_CURRENT_SITE', 'www.naam.nl' );
    define(   'PATH_CURRENT_SITE', '/' );
    define(   'SITE_ID_CURRENT_SITE', 1 );
    define(   'BLOG_ID_CURRENT_SITE', 1 );




    then adjust/make .htaccess in the root of your WordPress installation
WordPress - multisites network, settings

                                                         .htaccess              adjust permalinks settings

       http://www.naam.nl
         http://www.naam.nl
        http://www.name.nl/
           http://www.naam.nl
                  subsite1




    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond   %{REQUEST_FILENAME} -f [OR]
    RewriteCond   %{REQUEST_FILENAME} -d
    RewriteRule   ^ - [L]
    RewriteRule    ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule    ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L]
    RewriteRule   . index.php [L]



    re-login
WordPress - multisites network, serversettings

                                                    httpd config



       http://www.naam.nl
         http://www.naam.nl
        http://www.naam.nl/
           http://www.naam.nl
               subsite1




    the settings below differ between various webservers, but in most cases,
    look foor httpd config files in the server map.
    You need access to this file! Ask your provider if you have access in your agreement

    <Directory "/Library/WebServer/Documents/naamhoofddomein">
    	     	      AllowOverride All
    	     	      <IfModule mod_dav.c>
    	     	      	      DAV Off
    	     	      </IfModule>
    	     	      Options All -Includes -ExecCGI +MultiViews -Indexes
    </Directory>

    restart webserver
WordPress - multisites network, permalinks


     http://www.naam.nl
       http://www.naam.nl
      http://www.name.nl/
         http://www.naam.nl
           subsite1
WordPress - multisites network, serversettings

                                      wp-content



      http://www.naam.nl
        http://www.naam.nl
       http://www.name.nl/
          http://www.naam.nl
            subsite1




    make directory ‘blogs-dir’ in wp-content with chmod (755)
WordPress
Part 6: plugins




by Peter Luit
WordPress - plugins, the basics

                     actions                                                          filters



             are functions to be executed                                    are buffers before content is
            based on a certain condition or                                 written into the SQL database
                         place                                               or displayed in the browser




  add_action ( 'publish_post', 'email_friends' );    add_filter ( 'hook_name', 'your_filter', [priority], [accepted_args] );



                                                    hook
                                                     into
                                                    core

                   - the core of WordPress consists of very many actions
                   and filters. Themes add actions and filters to this list
                   depending of the theme developer.

                            http://adambrown.info/p/wp_hooks/version/3.1
WordPress - plugins, the setup


     wordpress home



                                          wp-content



                                                                          plugins




                                                                                    mainfile.php
                                                                                       (css)
    header of the base of a plugin php file                                              (js)
                                                                                       (php)
    <?php
    /*
    Plugin Name: Platform - Nav Colors
    Plugin URI: http://www.pagelines.com/
    Description: An example plugin showing how easy it is to extend the
    PageLines settings.
    Version: 0.1
    Author: PageLines
    Author URI: http://www.pagelines.com
    */
WordPress - plugins, required knowledge




- WordPress structure (the core, actions, filters, hooks)
- HTML (general base knowlegde)
- PHP (scripting language to connect SQL and HTML))
- SQL (making off, writing and reading from tables)
- CSS (fir making the look and feel)
- JavaScript/AJAX (clientsite interactive/animation like functions)
WordPress
Part 7: CSS, the basics




by Peter Luit
WordPress - CSS, the basics

                                                              1             2     3



          childtheme
                                                                            2a

                                                                            2b




                                                       newest

          parenttheme




                                                         posts (timeline)




                                                                                 pages
 plugin    plugin            plugin   plugin
                    plugin




                                                       oldest
                WP core



 - child themes use basic settings from the parent theme
 - updating a parent will not overwrite settings in the child
WordPress - CSS, the basics

                                      - some thems give the possibility
         parenttheme                  to do local CSS editting in a build-in
                                      editor and export settings




         childtheme                   - child take base CSS from parent




         CSS                          - edit CSS in your child theme

                    typography        - type, style, size, color, place
                 places of elements   - margin, padding etc.
                  mouse actions       - hover, visited etc.
WordPress - CSS, basics in child theme

                                 Baselines in childtheme:


       /*
       Theme Name: Luit
       Description: Child Theme based on Suffusion, edited by Peter Luit
       Theme URI: http://www.naam.nl
       Description: Child theme for the Suffussion theme
       Author: Peter Luit
       Author URI: http://www.luit.nl
       Template: suffusion
       Tags: buddypress
       Version: 1.0
       */
       @import url("../suffusion/style.css");
       @import url("../suffusion/skins/light-theme-orange/skin.css");
WordPress - CSS, basics
CSS                               HTML                                result

body {                            margin-right for everything after        15 pixels to the
	    margin-right: 15px;
                                  HTML <body> tag                          right
}




.karakter {                       geldt alleen bij:                   display
	     font-weight: bold;          <DIV class=‘karakter’>
}                                   display
                                  </DIV>



#extra {                          geldt alleen bij:
	    background-color: #FF0000;   <DIV class=‘karakter’ ID=‘extra’>   display
}                                   display
                                  </DIV>

More Related Content

Viewers also liked

Step by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress plugin
Mainak Goswami
 
Architecture Behind Wordpress
Architecture Behind WordpressArchitecture Behind Wordpress
Architecture Behind Wordpress
indrio
 
WordPress as a CMS - Case Study of an Organizational Intranet
WordPress as a CMS - Case Study of an Organizational IntranetWordPress as a CMS - Case Study of an Organizational Intranet
WordPress as a CMS - Case Study of an Organizational Intranet
Tech Liminal
 
Arquitetura da Informação e Wordpress
Arquitetura da Informação e WordpressArquitetura da Informação e Wordpress
Arquitetura da Informação e Wordpress
UTFPR
 
Project report-on-student-information-management-system-php-mysql
Project report-on-student-information-management-system-php-mysqlProject report-on-student-information-management-system-php-mysql
Project report-on-student-information-management-system-php-mysql
Raj Sharma
 

Viewers also liked (16)

Workshop 4: IJssel-Vechtdelta lessons learned
Workshop 4: IJssel-Vechtdelta lessons learnedWorkshop 4: IJssel-Vechtdelta lessons learned
Workshop 4: IJssel-Vechtdelta lessons learned
 
Step by step guide for creating wordpress plugin
Step by step guide for creating wordpress pluginStep by step guide for creating wordpress plugin
Step by step guide for creating wordpress plugin
 
Content Architecture WordPress Hamilton
Content Architecture WordPress HamiltonContent Architecture WordPress Hamilton
Content Architecture WordPress Hamilton
 
Architecture Behind Wordpress
Architecture Behind WordpressArchitecture Behind Wordpress
Architecture Behind Wordpress
 
CMS Capabilities of WordPress
CMS Capabilities of WordPressCMS Capabilities of WordPress
CMS Capabilities of WordPress
 
WordPress as a CMS - Case Study of an Organizational Intranet
WordPress as a CMS - Case Study of an Organizational IntranetWordPress as a CMS - Case Study of an Organizational Intranet
WordPress as a CMS - Case Study of an Organizational Intranet
 
Advantages & Disadvantages of Wordpress
Advantages & Disadvantages of WordpressAdvantages & Disadvantages of Wordpress
Advantages & Disadvantages of Wordpress
 
WordPress Websites that work
WordPress   Websites that workWordPress   Websites that work
WordPress Websites that work
 
Core (Data Model) of WordPress Core
Core (Data Model) of WordPress CoreCore (Data Model) of WordPress Core
Core (Data Model) of WordPress Core
 
Arquitetura da Informação e Wordpress
Arquitetura da Informação e WordpressArquitetura da Informação e Wordpress
Arquitetura da Informação e Wordpress
 
Introduction to WordPress Class 1
Introduction to WordPress Class 1Introduction to WordPress Class 1
Introduction to WordPress Class 1
 
Wordpress site scaling architecture on cloud infrastructure with AWS
Wordpress site scaling architecture on cloud infrastructure with AWSWordpress site scaling architecture on cloud infrastructure with AWS
Wordpress site scaling architecture on cloud infrastructure with AWS
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin Development
 
WordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress OptimizationWordCamp Ireland - 40 tips for WordPress Optimization
WordCamp Ireland - 40 tips for WordPress Optimization
 
Wordpress Plugin Development Short Tutorial
Wordpress Plugin Development Short TutorialWordpress Plugin Development Short Tutorial
Wordpress Plugin Development Short Tutorial
 
Project report-on-student-information-management-system-php-mysql
Project report-on-student-information-management-system-php-mysqlProject report-on-student-information-management-system-php-mysql
Project report-on-student-information-management-system-php-mysql
 

More from Peter Luit

Winkeliersverening ijmuiden
Winkeliersverening ijmuidenWinkeliersverening ijmuiden
Winkeliersverening ijmuiden
Peter Luit
 

More from Peter Luit (20)

Wordcamp Utrecht 2019
Wordcamp Utrecht 2019Wordcamp Utrecht 2019
Wordcamp Utrecht 2019
 
Relationeel - database gebruik voor effectieve web communicatie in WordPress
Relationeel - database gebruik voor effectieve web communicatie in WordPressRelationeel - database gebruik voor effectieve web communicatie in WordPress
Relationeel - database gebruik voor effectieve web communicatie in WordPress
 
Fishbook - uitleg
Fishbook - uitlegFishbook - uitleg
Fishbook - uitleg
 
Starten met een eigen wordpress website - bonus
Starten met een eigen wordpress website - bonusStarten met een eigen wordpress website - bonus
Starten met een eigen wordpress website - bonus
 
Online usability - les 3 introductie WordPress - thema's, widgets en plugins
Online usability - les 3 introductie WordPress - thema's, widgets en pluginsOnline usability - les 3 introductie WordPress - thema's, widgets en plugins
Online usability - les 3 introductie WordPress - thema's, widgets en plugins
 
Online usability - les 2 introductie WordPress
Online usability - les 2 introductie WordPressOnline usability - les 2 introductie WordPress
Online usability - les 2 introductie WordPress
 
Online usability - les 1 introductie WordPress - structuur en content
Online usability - les 1 introductie WordPress - structuur en contentOnline usability - les 1 introductie WordPress - structuur en content
Online usability - les 1 introductie WordPress - structuur en content
 
Hyperlocal Academy - deel 2: techniek
Hyperlocal Academy - deel 2: techniekHyperlocal Academy - deel 2: techniek
Hyperlocal Academy - deel 2: techniek
 
Les 4 Inct. Training WordPress
Les 4 Inct. Training WordPressLes 4 Inct. Training WordPress
Les 4 Inct. Training WordPress
 
Les 3 Inct. Training WordPress
Les 3 Inct. Training WordPressLes 3 Inct. Training WordPress
Les 3 Inct. Training WordPress
 
Les 2 Inct. Training WordPress
Les 2 Inct. Training WordPressLes 2 Inct. Training WordPress
Les 2 Inct. Training WordPress
 
Les 1 Inct. Training WordPress
Les 1 Inct. Training WordPressLes 1 Inct. Training WordPress
Les 1 Inct. Training WordPress
 
Website Usability deel 3: vervolg WordPress
Website Usability deel 3: vervolg WordPressWebsite Usability deel 3: vervolg WordPress
Website Usability deel 3: vervolg WordPress
 
Online Usability training Hogeschool Utrecht - CCJ
Online Usability training Hogeschool Utrecht - CCJOnline Usability training Hogeschool Utrecht - CCJ
Online Usability training Hogeschool Utrecht - CCJ
 
Winkeliersverening ijmuiden
Winkeliersverening ijmuidenWinkeliersverening ijmuiden
Winkeliersverening ijmuiden
 
Velsenaanzee3
Velsenaanzee3Velsenaanzee3
Velsenaanzee3
 
Starten met social media voor MKB bedrijven
Starten met social media voor MKB bedrijvenStarten met social media voor MKB bedrijven
Starten met social media voor MKB bedrijven
 
Geld verdienen met social media: een kritische kijk op hetgeen gaande is....
Geld verdienen met social media: een kritische kijk op hetgeen gaande is....Geld verdienen met social media: een kritische kijk op hetgeen gaande is....
Geld verdienen met social media: een kritische kijk op hetgeen gaande is....
 
MailChimp - introductie en diepgang
MailChimp - introductie en diepgangMailChimp - introductie en diepgang
MailChimp - introductie en diepgang
 
Effectieve inzet cross- en social media les 1
Effectieve inzet cross- en social media les 1Effectieve inzet cross- en social media les 1
Effectieve inzet cross- en social media les 1
 

Recently uploaded

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

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...
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
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
 
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
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 

Under the hood of WordPress

  • 1. WordPress: ‘under the hood’ by Peter Luit @peterluit
  • 2. Meant for..... • WordPress users, who • know the admin part and how to make pages en posts • know how to place media elements in pages and postst • know how to handle categories and tags • know the concept of plug ins • know the concept of themes • know to use the menu system
  • 3. WordPress Part 1: the basics by Peter Luit
  • 4. Website - pages meant for ‘static’ content pages
  • 5. Weblog - articles (posts, blogs) meant for ‘dynamic’ content newest posts (timeline) oldest
  • 6. WordPress - posts/pages WordPress knows both types of content newest posts (timeline) pages oldest
  • 7. WordPress - menu structure (starting with 3.0) 1 2 3 - external links 2a - posts 2b - pages - categories(*) - tags(*) newest posts (timeline) pages oldest * categories and tags only applicable for posts
  • 8. WordPress - sidebars, extra areas 1 2 3 * depending on theme 2a possibilities 2b * newest * posts (timeline) pages * * * * oldest *
  • 9. WordPress - widgets 1 2 3 2a 2b newest posts (timeline) pages oldest - widgets are independent areas in the sidebars - a widgets can display results of a plugin or contain static text
  • 10. WordPress - header/footer 1 2 3 2a 2b newest posts (timeline) pages oldest header en footer size/position
  • 11. WordPress - plug-ins 1 2 3 added functions, for example 2a contactform, social media icons, 2b read article counter etc. newest posts (timeline) plugin pages plugin plugin plugin plugin oldest WP core
  • 12. WordPress - themes 1 2 3 2a theme 2b newest posts (timeline) plugin pages plugin plugin plugin plugin oldest WP core - themes determine the totel user interface - free and premium (mostly paid) versions - very big differences in possibilities
  • 14. WordPress - Architecture ‘fixed’ content metadata pagina’s title comments(*) body media ‘timeline’ content metadata timeline (blogs) title category tags comments(*) body media * optional
  • 15. WordPress - Menu menu item empty (#) URL page(s) post(s) categorie(s) tag(s)
  • 16. WordPress - Choosing a theme very basic basic advanced - no or very limited - adjustments possible - may adjustments and adjustments - variable layout export of settings - fixed layout - most often for free - in most cases paid - limited sidebars - internal CSS editting themes - mostly free possible - framwork for developing - export of settings file child themes - CSS/PHP knowledge required
  • 17. WordPress - Choosing a theme (examples) • Free: Twenty Eleven (standard WordPress theme, sinple but fine for strating projects) • Free: Atahualpa (generates chaotic HTML code, but many possibilities) • Free: Suffusion (modern ‘block’ oriented theme, many adjustments) • Paid: PlatformPro (custom post types in design, suitable for child themes, internal CSS settings possible) • Paid: BizzFolio (business design, interbal CSS settings possible) • Paid: Genesis (framework for developing advanced child themes)
  • 18. WordPress - Frameworks • In many cases a confusing name with two meanings • A - possible very advanced - parent theme, from which child themes can be made (mostly they supply very useful CSS documentation) • Genesis, Hybrid, Thematic etc. • Atahualpa also says to be a framework..... • A seperate development tool for making parent themes (is not a theme by itself!) • Hybrid Core • Artisteer
  • 19. WordPress - parentthemes and childthemes 1 2 3 childtheme 2a 2b newest parenttheme posts (timeline) pages plugin plugin plugin plugin plugin oldest WP core - child theme uses base settings from the parent theme - updating parent theme does not influence settings in child theme
  • 20. WordPress - parentthemes and childthemes design(*) functionality childtheme aanvullende CSS aanvullende PHP examples: ‘gets base from parent’ - functions.php @import url("../theme/ - header.php style.css"); - footer.php etc. css knowledge required php knowledge required parenttheme base CSS base PHP * for CSS see part 7
  • 21. WordPress - parent- en childthemes • Child themes: don’t make too complex child themes • The main purpose: Child themes contain relatively simple personal settings based on changed settings/routines from the parent theme • The parent theme can be updated with new versions, leaving the child theme untouched • Making a child theme (too?) complex might result in errors/warnings after upgrading the parent theme • don’t make a new parent theme with a child theme......
  • 22. WordPress Part 3: hooks(*) door Peter Luit * also look at part 6: plugins
  • 23. WordPress - hooks (actions and filters) 1 2 3 2a childtheme 2b newest parenttheme hooks posts (timeline) pages plugins WP core oldest - ‘before’ and ‘after’ are the primary ‘locations’ of an event where/when a hooked action/filter will be executed
  • 24. WordPress - hooks, the basics add_action where name of function function name { what to do } where before/after header before/after siderbar(s) # - differs per theme - php knowledge required before after page # - place this in functions.php in childtheme before/after footer
  • 25. WordPress - hooks, example add_action('suffusion_before_begin_content', 'my_custom_before_page'); function my_custom_before_page() { if(is_page( 'mijn-home' )) { slidedeck( 146, array( 'width' => '100%', 'height' => '225px' ) ); } } - suffusion_before_begin_content is a location definition in the Suffusion theme - my_custom_before_page is the name of the routine to be made - function defines the beginning of the new routine - this example puts slidedeck slideshow (is a plugin) only at page ‘mijn-home’ - slidedeck( 146, array( 'width' => '100%', 'height' => '225px' ) ); is the format in which slidedeck data must be used - place the code above in functions.php in child theme
  • 26. WordPress Part 4: custom post types by Peter Luit
  • 27. WordPress - custom post types, example example within Platform Pro 3 boxes at the homepage of luit.nl
  • 28. WordPress - custom post types, at luit.nl features boxes carousel
  • 29. WordPress - custom post types WP standard example posts events pages booklist holiday destinations - moderne themes bouwen specifieke custom post types in (bijv. PlatformPro) - er zijn diverse plug-ins om custom post types interactief te kunnen maken
  • 30. WordPress - custom post types, technology execute this after WP startup add_action ‘init’ name function name { labels WP functions(*), including the displayname display what will the user see? register regster the function } - place this in functions.php in child theme * like ‘add’, ‘edit’, ‘search’, ‘view’ ......
  • 31. WordPress - custom post types, display content single.php base to display single content maak een copy bijv. single-event.php place in child theme look for <h1 class="entry-title"><?php the_title(); ?></h1> replace with <h1 class="entry-title">Event: <?php the_title(); ?></h1>
  • 32. WordPress Part 5: multisites and permalinks by Peter Luit
  • 33. WordPress - multisites network one website via subdirectories via subdomains http://www.name.nl http://www.naam.nl http://www.naam.nl http://www.naam.nl http://www.naam.nl http://www.name.nl/ http://www.naam.nl http://www.naam.nl http://subsite1.name.nl subsite1 - own look&feel - own menu - own content
  • 34. WordPress - multisites network, settings wp-config.php adjust .htaccess make/adjust http://www.naam.nl http://www.naam.nl http://www.name.nl/ http://www.naam.nl subsite1 httpd config adjust (server dependend) permalinks adjust wp-content/blogs.dir make
  • 35. WordPress - multisites network, settings wp-config.php adjust http://www.naam.nl http://www.naam.nl http://www.naam.nl/ http://www.naam.nl subsite1 define('WP_ALLOW_MULTISITE', true); -- plaats dit net voor /* That's all, stop editing! Happy blogging. */: login agian, add the following after the line you just inserted in config.php: define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', false ); $base = '/'; define( 'DOMAIN_CURRENT_SITE', 'www.naam.nl' ); define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 ); then adjust/make .htaccess in the root of your WordPress installation
  • 36. WordPress - multisites network, settings .htaccess adjust permalinks settings http://www.naam.nl http://www.naam.nl http://www.name.nl/ http://www.naam.nl subsite1 RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] RewriteRule ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L] RewriteRule . index.php [L] re-login
  • 37. WordPress - multisites network, serversettings httpd config http://www.naam.nl http://www.naam.nl http://www.naam.nl/ http://www.naam.nl subsite1 the settings below differ between various webservers, but in most cases, look foor httpd config files in the server map. You need access to this file! Ask your provider if you have access in your agreement <Directory "/Library/WebServer/Documents/naamhoofddomein"> AllowOverride All <IfModule mod_dav.c> DAV Off </IfModule> Options All -Includes -ExecCGI +MultiViews -Indexes </Directory> restart webserver
  • 38. WordPress - multisites network, permalinks http://www.naam.nl http://www.naam.nl http://www.name.nl/ http://www.naam.nl subsite1
  • 39. WordPress - multisites network, serversettings wp-content http://www.naam.nl http://www.naam.nl http://www.name.nl/ http://www.naam.nl subsite1 make directory ‘blogs-dir’ in wp-content with chmod (755)
  • 41. WordPress - plugins, the basics actions filters are functions to be executed are buffers before content is based on a certain condition or written into the SQL database place or displayed in the browser add_action ( 'publish_post', 'email_friends' ); add_filter ( 'hook_name', 'your_filter', [priority], [accepted_args] ); hook into core - the core of WordPress consists of very many actions and filters. Themes add actions and filters to this list depending of the theme developer. http://adambrown.info/p/wp_hooks/version/3.1
  • 42. WordPress - plugins, the setup wordpress home wp-content plugins mainfile.php (css) header of the base of a plugin php file (js) (php) <?php /* Plugin Name: Platform - Nav Colors Plugin URI: http://www.pagelines.com/ Description: An example plugin showing how easy it is to extend the PageLines settings. Version: 0.1 Author: PageLines Author URI: http://www.pagelines.com */
  • 43. WordPress - plugins, required knowledge - WordPress structure (the core, actions, filters, hooks) - HTML (general base knowlegde) - PHP (scripting language to connect SQL and HTML)) - SQL (making off, writing and reading from tables) - CSS (fir making the look and feel) - JavaScript/AJAX (clientsite interactive/animation like functions)
  • 44. WordPress Part 7: CSS, the basics by Peter Luit
  • 45. WordPress - CSS, the basics 1 2 3 childtheme 2a 2b newest parenttheme posts (timeline) pages plugin plugin plugin plugin plugin oldest WP core - child themes use basic settings from the parent theme - updating a parent will not overwrite settings in the child
  • 46. WordPress - CSS, the basics - some thems give the possibility parenttheme to do local CSS editting in a build-in editor and export settings childtheme - child take base CSS from parent CSS - edit CSS in your child theme typography - type, style, size, color, place places of elements - margin, padding etc. mouse actions - hover, visited etc.
  • 47. WordPress - CSS, basics in child theme Baselines in childtheme: /* Theme Name: Luit Description: Child Theme based on Suffusion, edited by Peter Luit Theme URI: http://www.naam.nl Description: Child theme for the Suffussion theme Author: Peter Luit Author URI: http://www.luit.nl Template: suffusion Tags: buddypress Version: 1.0 */ @import url("../suffusion/style.css"); @import url("../suffusion/skins/light-theme-orange/skin.css");
  • 48. WordPress - CSS, basics CSS HTML result body { margin-right for everything after 15 pixels to the margin-right: 15px; HTML <body> tag right } .karakter { geldt alleen bij: display font-weight: bold; <DIV class=‘karakter’> } display </DIV> #extra { geldt alleen bij: background-color: #FF0000; <DIV class=‘karakter’ ID=‘extra’> display } display </DIV>