SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Wordpress	
  themes
• Wordpress	
  can	
  install	
  themes	
  to	
  change	
  the	
  “look	
  and	
  
feel”	
  of	
  the	
  site.
• h7p://wordpress.org/extend/themes/
• Your	
  first	
  assignment	
  is	
  to	
  create	
  your	
  own	
  wordpress	
  
theme	
  which	
  uniquely	
  services	
  the	
  content	
  and	
  purpose	
  
of	
  your	
  site.
1
Wordpress	
  themes	
  admin	
  interface
2
Wordpress	
  themes	
  directory
• h7p://wordpress.org/extend/themes/
3
Using	
  a	
  pre-­‐made	
  theme
• Advantages
–	
  quick	
  &	
  easy
–	
  plenty	
  of	
  well-­‐made	
  free	
  themes
–	
  can	
  modify	
  to	
  suit	
  your	
  own	
  needs
• Disadvantages
–	
  generic	
  -­‐	
  so	
  not	
  made	
  with	
  your	
  unique	
  content	
  or	
  aestheJc	
  in	
  mind
–	
  depending	
  on	
  how	
  much	
  customisaJon	
  you	
  do,	
  it	
  can	
  actually	
  end	
  up	
  taking	
  you	
  
longer	
  and	
  cosJng	
  more	
  than	
  doing	
  your	
  own	
  from	
  scratch	
  
4
CreaJng	
  your	
  own	
  theme	
  from	
  scratch
• Disadvantages
–	
  can	
  take	
  longer	
  and	
  be	
  costlier
–	
  you	
  have	
  to	
  learn	
  how	
  to	
  make	
  themes
• Advantages
–	
  Unique
–	
  completely	
  flexible	
  and	
  customisable
–	
  complete	
  control	
  over	
  resources	
  -­‐	
  no	
  waste
–	
  you	
  get	
  to	
  learn	
  how	
  to	
  make	
  themes!
5
Anatomy	
  of	
  a	
  Wordpress	
  theme
• wordpress	
  themes	
  are	
  installed	
  to	
  the	
  wp-­‐content/themes	
  directory
6
Anatomy	
  of	
  a	
  Wordpress	
  theme
• consist	
  of	
  a	
  collecJon	
  of	
  php	
  files	
  as	
  
well	
  as	
  one	
  or	
  more	
  css	
  files	
  and	
  
associated	
  resources	
  (e.g.	
  imagery,	
  
javascript	
  files	
  etc.).
7
Anatomy	
  of	
  a	
  Wordpress	
  theme
• php	
  files	
  contain	
  html	
  markup	
  interspersed	
  with	
  php	
  snippets	
  which	
  
retrieve	
  content	
  from	
  the	
  wordpress	
  database	
  and	
  output	
  the	
  result	
  to	
  
plain	
  html	
  for	
  the	
  browser	
  to	
  render
8
Template	
  tags
• Wordpress	
  uses	
  it’s	
  own	
  php	
  funcJons	
  called	
  template	
  tags	
  
to	
  output	
  informaJon	
  to	
  the	
  page.
• For	
  example	
  in	
  the	
  next	
  slide	
  the	
  template	
  tag	
  bloginfo	
  is	
  
used	
  to	
  get	
  the	
  name	
  of	
  the	
  site	
  from	
  the	
  database	
  and	
  
output	
  it	
  within	
  the	
  <Jtle>	
  html	
  element.	
  	
  
• These	
  handy	
  funcJons	
  save	
  us	
  from	
  wriJng	
  a	
  lot	
  of	
  extra	
  
php	
  code.
9
header.php	
  template	
  file
10
view-­‐source	
  in	
  the	
  browser
So	
  where	
  do	
  we	
  find	
  out	
  what	
  data	
  wordpress	
  can	
  retrieve	
  
and	
  what	
  php	
  code	
  retrieves	
  it?	
  
• The	
  wordpress	
  codex
–h7p://codex.wordpress.org/Template_Tags
–h7p://codex.wordpress.org/FuncJon_Reference/bloginfo
• Look	
  at	
  other	
  themes
• google	
  it
–	
  e.g.	
  h7p://www.google.com.au/search?hl=en&qscrl=1&q=wordpress
+display+blog+name&aq=f&aqi=&aql=&oq=&gs_rfai=
11
Anatomy	
  of	
  a	
  Wordpress	
  theme
• wordpress	
  page	
  structure	
  can	
  be	
  logically	
  secJoned	
  
into	
  a	
  number	
  of	
  building	
  blocks.
• each	
  of	
  these	
  blocks	
  correspond	
  to	
  a	
  separate	
  php	
  file	
  
in	
  the	
  theme	
  directory	
  (wordpress	
  expects	
  these	
  files	
  
to	
  have	
  parJcular	
  names	
  like	
  header.php,	
  footer.php,	
  
sidebar.php	
  etc).
• each	
  block	
  (file)	
  can	
  be	
  included	
  and	
  reused	
  in	
  mulJple	
  
page	
  templates	
  using	
  template	
  tags	
  like	
  <?php	
  
get_header();	
  ?>
12
Anatomy	
  of	
  a	
  Wordpress	
  theme
13
Anatomy	
  of	
  a	
  Wordpress	
  theme
14
h7p://www.webdesignerwall.com/tutorials/building-­‐custom-­‐wordpress-­‐theme/
Anatomy	
  of	
  a	
  Wordpress	
  theme
15
h7p://www.webdesignerwall.com/tutorials/building-­‐custom-­‐wordpress-­‐theme/
default	
  template	
  for	
  a	
  single	
  post	
  -­‐	
  single.php
Template	
  Hierarchy
16
h7p://codex.wordpress.org/Template_Hierarchy
Anatomy	
  of	
  a	
  Wordpress	
  theme
• Use	
  as	
  much	
  or	
  as	
  li7le	
  of	
  the	
  template	
  
hierarchy	
  as	
  your	
  site	
  requires.
• lets	
  look	
  at	
  some	
  of	
  the	
  most	
  common	
  
template	
  files...
17
header.php
• usually	
  contains	
  the	
  doctype,	
  metadata	
  and	
  <head>	
  secJon	
  of	
  
the	
  html	
  document
• may	
  contain	
  the	
  top	
  navigaJon
• include	
  the	
  header	
  in	
  other	
  template	
  files	
  to	
  avoid	
  duplicaJng	
  
the	
  code	
  it	
  contains	
  with	
  <?php	
  get_header();	
  ?>
18
footer.php
• anything	
  you	
  would	
  normally	
  put	
  in	
  a	
  common	
  page	
  footer.	
  	
  
• include	
  the	
  footer	
  in	
  other	
  template	
  files	
  to	
  avoid	
  duplicaJng	
  
the	
  code	
  it	
  contains	
  with	
  <?php	
  get_footer();	
  ?>
19
sidebar.php
• commonly	
  contains:
–	
  navigaJon	
  (main	
  and/or	
  subnav)
–	
  links	
  (internal	
  and	
  external)
–	
  searchform
–	
  widgeJsed	
  plugins	
  that	
  can	
  be	
  added	
  and	
  removed	
  
through	
  the	
  administrator	
  interface	
  (dashboard)
• include	
  the	
  sidebar	
  in	
  other	
  template	
  files	
  with	
  
<?php	
  get_sidebar(	
  $name	
  );	
  ?>
20
sidebar	
  -­‐	
  widgets
21
The	
  content
• Wordpress	
  has	
  2	
  main	
  content	
  types,	
  posts	
  and	
  pages
• The	
  3	
  main	
  template	
  files	
  associated	
  with	
  displaying	
  these	
  are	
  
single.php,	
  page.php	
  and	
  index.php
22
index.php
• default	
  frontpage
• usually	
  displays	
  excerpts	
  of	
  recent	
  posts
• use	
  the	
  wordpress	
  loop	
  to	
  ouput	
  posts
–	
  h7p://codex.wordpress.org/The_Loop
• usually	
  includes	
  the	
  header,	
  footer	
  and	
  sidebar	
  
template	
  files
23
single.php
• displays	
  the	
  enJre	
  contents	
  of	
  a	
  single	
  post
• may	
  display	
  comments	
  if	
  enabled
• usually	
  includes	
  header	
  and	
  footer	
  template	
  
files
24
page.php
• displays	
  the	
  contents	
  of	
  a	
  wordpress	
  page	
  
content	
  item
• may	
  display	
  comments	
  if	
  enabled
• usually	
  includes	
  header	
  and	
  footer	
  template	
  
files
25
categories.php
• wordpress	
  supports	
  categorising	
  posts	
  in	
  a	
  custom	
  taxonomy.
• It	
  can	
  be	
  useful	
  to	
  have	
  pages	
  that	
  only	
  show	
  posts	
  in	
  a	
  given	
  category.
• You	
  can	
  provide	
  a	
  navigaJon	
  menu	
  that	
  links	
  to	
  various	
  categories	
  as	
  a	
  
way	
  of	
  secJoning	
  your	
  site	
  content.
–	
  e.g.	
  h7p://www.smashingmagazine.com/
26
funcJons.php
• the	
  funcJons	
  file	
  is	
  different	
  in	
  that	
  it	
  doesn’t	
  map	
  to	
  any	
  
displayable	
  content	
  block	
  on	
  the	
  page
• it	
  is	
  simply	
  a	
  place	
  to	
  store	
  any	
  reusable	
  funcJons	
  that	
  can	
  
be	
  used	
  by	
  any	
  other	
  template	
  files.
• it	
  is	
  automaJcally	
  “included”	
  by	
  Wordpress	
  (so	
  you	
  don’t	
  
need	
  to	
  use	
  include	
  or	
  require	
  statements	
  before	
  accessing	
  
it	
  from	
  another	
  template	
  file)
27
Anatomy	
  of	
  a	
  Wordpress	
  theme
• for	
  a	
  more	
  detailed	
  and	
  complete	
  list	
  of	
  template	
  files	
  see	
  the	
  Wordpress	
  
codex,	
  parJcularly:
– h7p://codex.wordpress.org/Stepping_Into_Templates
– h7p://codex.wordpress.org/Theme_Development
– h7p://codex.wordpress.org/Site_Architecture_1.5
– h7p://codex.wordpress.org/Template_Hierarchy
• for	
  a	
  complete	
  list	
  of	
  wordpress	
  funcJons	
  and	
  template	
  tags	
  (the	
  bits	
  of	
  
php	
  you	
  use	
  to	
  get	
  stuff	
  from	
  the	
  database)	
  see	
  the	
  following:
– 	
  h7p://codex.wordpress.org/FuncJon_Reference
– 	
  h7p://codex.wordpress.org/Template_Tags
28
NavigaJon	
  menus
• the	
  template	
  tags	
  wp_list_pages	
  and	
  wp_list_categories	
  
will	
  output	
  a	
  list	
  of	
  links	
  (<li><a>...</a></li>)	
  that	
  can	
  be	
  
styled	
  like	
  any	
  list	
  based	
  navigaJon	
  menu.
–	
  h7p://codex.wordpress.org/FuncJon_Reference/wp_list_pages
–	
  h7p://codex.wordpress.org/Template_Tags/wp_list_categories
• CSS	
  lists	
  -­‐	
  h7p://css.maxdesign.com.au/listamaJc/
29
So	
  what	
  about	
  the	
  CSS?
• This	
  is	
  probably	
  the	
  least	
  different	
  part	
  of	
  developing	
  a	
  Wordpress	
  
theme	
  compared	
  with	
  a	
  staJc	
  website.
• The	
  style.css	
  sits	
  in	
  the	
  theme	
  directory	
  and	
  is	
  usually	
  added	
  to	
  the	
  
header.php	
  with	
  a	
  standard	
  link	
  tag,	
  but	
  with	
  a	
  Wordpress	
  funcJon	
  in	
  
place	
  of	
  the	
  url.
–	
  <link	
  rel="stylesheet"	
  type="text/css"	
  media="all"	
  href="<?php	
  
bloginfo(	
  'stylesheet_url'	
  );	
  ?>"	
  />	
  
• Get	
  used	
  to	
  using	
  firebug	
  or	
  a	
  similar	
  html/css	
  inspecJon	
  tool	
  -­‐	
  it	
  is	
  even	
  
more	
  of	
  useful	
  when	
  working	
  with	
  dynamic	
  websites.
30
Installing	
  the	
  theme
• Wordpress	
  looks	
  for	
  some	
  pre-­‐defined	
  text	
  in	
  a	
  comment	
  block	
  at	
  the	
  
top	
  of	
  style.css	
  so	
  it	
  can	
  display	
  this	
  informaJon	
  about	
  the	
  theme	
  in	
  the	
  
administrator	
  interface.
31
Installing	
  the	
  theme
• it	
  also	
  looks	
  for	
  a	
  file	
  called	
  screenshot.png	
  in	
  
the	
  template	
  directory	
  to	
  provide	
  a	
  preview	
  
thumbnail	
  of	
  the	
  theme
32
Installing	
  the	
  theme
• installing	
  the	
  theme	
  is	
  simply	
  a	
  ma7er	
  of	
  pupng	
  the	
  theme	
  folder	
  in	
  the	
  
wp-­‐content/themes	
  directory	
  and	
  acJvaJng	
  it	
  through	
  the	
  Wordpress	
  
admin	
  interface.
33

Más contenido relacionado

La actualidad más candente

Multisite core concepts final
Multisite core concepts finalMultisite core concepts final
Multisite core concepts finalUmesh Chaudhary
 
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)Andrew Duthie
 
Basic Wordpress PPT
Basic Wordpress PPT Basic Wordpress PPT
Basic Wordpress PPT mayur akabari
 
WordPress vs Joomla Showdown
WordPress vs Joomla ShowdownWordPress vs Joomla Showdown
WordPress vs Joomla ShowdownPhelan Riessen
 
Web development using ASP.NET MVC
Web development using ASP.NET MVC Web development using ASP.NET MVC
Web development using ASP.NET MVC Adil Mughal
 
Wordpress essential training - Wordpress Presentation PPT
Wordpress essential training - Wordpress Presentation PPTWordpress essential training - Wordpress Presentation PPT
Wordpress essential training - Wordpress Presentation PPTAbdulla2410
 
Alice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPressLumosTech
 
WordPress for Education PPT
WordPress for Education PPTWordPress for Education PPT
WordPress for Education PPTjekkilekki
 
Introduction to WordPress 2016
Introduction to WordPress 2016Introduction to WordPress 2016
Introduction to WordPress 2016LumosTech
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web DevelopmentEric Greene
 
Introduction to word press
Introduction to word pressIntroduction to word press
Introduction to word pressLucky Ali
 
php with wordpress and mysql ppt by Naveen Tokas
 php with wordpress and mysql ppt by Naveen Tokas php with wordpress and mysql ppt by Naveen Tokas
php with wordpress and mysql ppt by Naveen TokasNAVEEN TOKAS
 

La actualidad más candente (20)

Multisite core concepts final
Multisite core concepts finalMultisite core concepts final
Multisite core concepts final
 
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
Launching a WordPress Site 101 (Cincinnati WordPress, August 2015)
 
Basic Wordpress PPT
Basic Wordpress PPT Basic Wordpress PPT
Basic Wordpress PPT
 
WordPress vs Joomla Showdown
WordPress vs Joomla ShowdownWordPress vs Joomla Showdown
WordPress vs Joomla Showdown
 
Wordpress
WordpressWordpress
Wordpress
 
Wordpress
WordpressWordpress
Wordpress
 
Web development using ASP.NET MVC
Web development using ASP.NET MVC Web development using ASP.NET MVC
Web development using ASP.NET MVC
 
Wordpress essential training - Wordpress Presentation PPT
Wordpress essential training - Wordpress Presentation PPTWordpress essential training - Wordpress Presentation PPT
Wordpress essential training - Wordpress Presentation PPT
 
Alice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu - WordPress For Beginners
Alice Phieu - WordPress For Beginners
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Intro to Wordpress
Intro to WordpressIntro to Wordpress
Intro to Wordpress
 
Beginning WordPress
Beginning WordPressBeginning WordPress
Beginning WordPress
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPress
 
WordPress for Education PPT
WordPress for Education PPTWordPress for Education PPT
WordPress for Education PPT
 
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
 
Introduction to WordPress 2016
Introduction to WordPress 2016Introduction to WordPress 2016
Introduction to WordPress 2016
 
WordPress Multisite
WordPress MultisiteWordPress Multisite
WordPress Multisite
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web Development
 
Introduction to word press
Introduction to word pressIntroduction to word press
Introduction to word press
 
php with wordpress and mysql ppt by Naveen Tokas
 php with wordpress and mysql ppt by Naveen Tokas php with wordpress and mysql ppt by Naveen Tokas
php with wordpress and mysql ppt by Naveen Tokas
 

Similar a Anatomy of a Wordpress theme

WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3David Bisset
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme ReviewCatch Themes
 
Wordpress template hierarchy
Wordpress template hierarchyWordpress template hierarchy
Wordpress template hierarchyStockton Group
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme developmentNaeem Junejo
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012Joe Querin
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteBrendan Sera-Shriar
 
Arizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress ThemeArizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress Themecertainstrings
 
WordPress Theme Workshop: Part 2
WordPress Theme Workshop: Part 2WordPress Theme Workshop: Part 2
WordPress Theme Workshop: Part 2David Bisset
 
Builing a WordPress Theme
Builing a WordPress ThemeBuiling a WordPress Theme
Builing a WordPress Themecertainstrings
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design WorkshopFaye Tandog
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25New Tricks
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With LoveUp2 Technology
 
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...WP Engine
 
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Word press bootcamp  By Sourcescript Innovations and Mentors DojoWord press bootcamp  By Sourcescript Innovations and Mentors Dojo
Word press bootcamp By Sourcescript Innovations and Mentors Dojolightshire
 
Word press interview question and answer tops technologies
Word press interview question and answer   tops technologiesWord press interview question and answer   tops technologies
Word press interview question and answer tops technologiesTOPS Technologies
 

Similar a Anatomy of a Wordpress theme (20)

WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme Review
 
Wordpress template hierarchy
Wordpress template hierarchyWordpress template hierarchy
Wordpress template hierarchy
 
Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme development
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media Institute
 
Arizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress ThemeArizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress Theme
 
WordPress Theme Workshop: Part 2
WordPress Theme Workshop: Part 2WordPress Theme Workshop: Part 2
WordPress Theme Workshop: Part 2
 
Builing a WordPress Theme
Builing a WordPress ThemeBuiling a WordPress Theme
Builing a WordPress Theme
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design Workshop
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
 
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
 
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Word press bootcamp  By Sourcescript Innovations and Mentors DojoWord press bootcamp  By Sourcescript Innovations and Mentors Dojo
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
 
Word press interview question and answer tops technologies
Word press interview question and answer   tops technologiesWord press interview question and answer   tops technologies
Word press interview question and answer tops technologies
 

Más de Dave Wallace

Lecture the dynamic web (2013)
Lecture   the dynamic web (2013)Lecture   the dynamic web (2013)
Lecture the dynamic web (2013)Dave Wallace
 
Mobile Web Design & Development 2012 Lecture
Mobile Web Design & Development 2012 LectureMobile Web Design & Development 2012 Lecture
Mobile Web Design & Development 2012 LectureDave Wallace
 
Mobile Web Design & Development 2011
Mobile Web Design & Development 2011Mobile Web Design & Development 2011
Mobile Web Design & Development 2011Dave Wallace
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Dave Wallace
 
The Edge - Datahack Workshop
The Edge - Datahack WorkshopThe Edge - Datahack Workshop
The Edge - Datahack WorkshopDave Wallace
 

Más de Dave Wallace (7)

Lecture the dynamic web (2013)
Lecture   the dynamic web (2013)Lecture   the dynamic web (2013)
Lecture the dynamic web (2013)
 
Mobile Web Design & Development 2012 Lecture
Mobile Web Design & Development 2012 LectureMobile Web Design & Development 2012 Lecture
Mobile Web Design & Development 2012 Lecture
 
The Dynamic Web
The Dynamic WebThe Dynamic Web
The Dynamic Web
 
Mobile Web Design & Development 2011
Mobile Web Design & Development 2011Mobile Web Design & Development 2011
Mobile Web Design & Development 2011
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011
 
Dynamic Web
Dynamic WebDynamic Web
Dynamic Web
 
The Edge - Datahack Workshop
The Edge - Datahack WorkshopThe Edge - Datahack Workshop
The Edge - Datahack Workshop
 

Último

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Último (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Anatomy of a Wordpress theme

  • 1. Wordpress  themes • Wordpress  can  install  themes  to  change  the  “look  and   feel”  of  the  site. • h7p://wordpress.org/extend/themes/ • Your  first  assignment  is  to  create  your  own  wordpress   theme  which  uniquely  services  the  content  and  purpose   of  your  site. 1
  • 3. Wordpress  themes  directory • h7p://wordpress.org/extend/themes/ 3
  • 4. Using  a  pre-­‐made  theme • Advantages –  quick  &  easy –  plenty  of  well-­‐made  free  themes –  can  modify  to  suit  your  own  needs • Disadvantages –  generic  -­‐  so  not  made  with  your  unique  content  or  aestheJc  in  mind –  depending  on  how  much  customisaJon  you  do,  it  can  actually  end  up  taking  you   longer  and  cosJng  more  than  doing  your  own  from  scratch   4
  • 5. CreaJng  your  own  theme  from  scratch • Disadvantages –  can  take  longer  and  be  costlier –  you  have  to  learn  how  to  make  themes • Advantages –  Unique –  completely  flexible  and  customisable –  complete  control  over  resources  -­‐  no  waste –  you  get  to  learn  how  to  make  themes! 5
  • 6. Anatomy  of  a  Wordpress  theme • wordpress  themes  are  installed  to  the  wp-­‐content/themes  directory 6
  • 7. Anatomy  of  a  Wordpress  theme • consist  of  a  collecJon  of  php  files  as   well  as  one  or  more  css  files  and   associated  resources  (e.g.  imagery,   javascript  files  etc.). 7
  • 8. Anatomy  of  a  Wordpress  theme • php  files  contain  html  markup  interspersed  with  php  snippets  which   retrieve  content  from  the  wordpress  database  and  output  the  result  to   plain  html  for  the  browser  to  render 8
  • 9. Template  tags • Wordpress  uses  it’s  own  php  funcJons  called  template  tags   to  output  informaJon  to  the  page. • For  example  in  the  next  slide  the  template  tag  bloginfo  is   used  to  get  the  name  of  the  site  from  the  database  and   output  it  within  the  <Jtle>  html  element.     • These  handy  funcJons  save  us  from  wriJng  a  lot  of  extra   php  code. 9
  • 11. So  where  do  we  find  out  what  data  wordpress  can  retrieve   and  what  php  code  retrieves  it?   • The  wordpress  codex –h7p://codex.wordpress.org/Template_Tags –h7p://codex.wordpress.org/FuncJon_Reference/bloginfo • Look  at  other  themes • google  it –  e.g.  h7p://www.google.com.au/search?hl=en&qscrl=1&q=wordpress +display+blog+name&aq=f&aqi=&aql=&oq=&gs_rfai= 11
  • 12. Anatomy  of  a  Wordpress  theme • wordpress  page  structure  can  be  logically  secJoned   into  a  number  of  building  blocks. • each  of  these  blocks  correspond  to  a  separate  php  file   in  the  theme  directory  (wordpress  expects  these  files   to  have  parJcular  names  like  header.php,  footer.php,   sidebar.php  etc). • each  block  (file)  can  be  included  and  reused  in  mulJple   page  templates  using  template  tags  like  <?php   get_header();  ?> 12
  • 13. Anatomy  of  a  Wordpress  theme 13
  • 14. Anatomy  of  a  Wordpress  theme 14 h7p://www.webdesignerwall.com/tutorials/building-­‐custom-­‐wordpress-­‐theme/
  • 15. Anatomy  of  a  Wordpress  theme 15 h7p://www.webdesignerwall.com/tutorials/building-­‐custom-­‐wordpress-­‐theme/ default  template  for  a  single  post  -­‐  single.php
  • 17. Anatomy  of  a  Wordpress  theme • Use  as  much  or  as  li7le  of  the  template   hierarchy  as  your  site  requires. • lets  look  at  some  of  the  most  common   template  files... 17
  • 18. header.php • usually  contains  the  doctype,  metadata  and  <head>  secJon  of   the  html  document • may  contain  the  top  navigaJon • include  the  header  in  other  template  files  to  avoid  duplicaJng   the  code  it  contains  with  <?php  get_header();  ?> 18
  • 19. footer.php • anything  you  would  normally  put  in  a  common  page  footer.     • include  the  footer  in  other  template  files  to  avoid  duplicaJng   the  code  it  contains  with  <?php  get_footer();  ?> 19
  • 20. sidebar.php • commonly  contains: –  navigaJon  (main  and/or  subnav) –  links  (internal  and  external) –  searchform –  widgeJsed  plugins  that  can  be  added  and  removed   through  the  administrator  interface  (dashboard) • include  the  sidebar  in  other  template  files  with   <?php  get_sidebar(  $name  );  ?> 20
  • 22. The  content • Wordpress  has  2  main  content  types,  posts  and  pages • The  3  main  template  files  associated  with  displaying  these  are   single.php,  page.php  and  index.php 22
  • 23. index.php • default  frontpage • usually  displays  excerpts  of  recent  posts • use  the  wordpress  loop  to  ouput  posts –  h7p://codex.wordpress.org/The_Loop • usually  includes  the  header,  footer  and  sidebar   template  files 23
  • 24. single.php • displays  the  enJre  contents  of  a  single  post • may  display  comments  if  enabled • usually  includes  header  and  footer  template   files 24
  • 25. page.php • displays  the  contents  of  a  wordpress  page   content  item • may  display  comments  if  enabled • usually  includes  header  and  footer  template   files 25
  • 26. categories.php • wordpress  supports  categorising  posts  in  a  custom  taxonomy. • It  can  be  useful  to  have  pages  that  only  show  posts  in  a  given  category. • You  can  provide  a  navigaJon  menu  that  links  to  various  categories  as  a   way  of  secJoning  your  site  content. –  e.g.  h7p://www.smashingmagazine.com/ 26
  • 27. funcJons.php • the  funcJons  file  is  different  in  that  it  doesn’t  map  to  any   displayable  content  block  on  the  page • it  is  simply  a  place  to  store  any  reusable  funcJons  that  can   be  used  by  any  other  template  files. • it  is  automaJcally  “included”  by  Wordpress  (so  you  don’t   need  to  use  include  or  require  statements  before  accessing   it  from  another  template  file) 27
  • 28. Anatomy  of  a  Wordpress  theme • for  a  more  detailed  and  complete  list  of  template  files  see  the  Wordpress   codex,  parJcularly: – h7p://codex.wordpress.org/Stepping_Into_Templates – h7p://codex.wordpress.org/Theme_Development – h7p://codex.wordpress.org/Site_Architecture_1.5 – h7p://codex.wordpress.org/Template_Hierarchy • for  a  complete  list  of  wordpress  funcJons  and  template  tags  (the  bits  of   php  you  use  to  get  stuff  from  the  database)  see  the  following: –  h7p://codex.wordpress.org/FuncJon_Reference –  h7p://codex.wordpress.org/Template_Tags 28
  • 29. NavigaJon  menus • the  template  tags  wp_list_pages  and  wp_list_categories   will  output  a  list  of  links  (<li><a>...</a></li>)  that  can  be   styled  like  any  list  based  navigaJon  menu. –  h7p://codex.wordpress.org/FuncJon_Reference/wp_list_pages –  h7p://codex.wordpress.org/Template_Tags/wp_list_categories • CSS  lists  -­‐  h7p://css.maxdesign.com.au/listamaJc/ 29
  • 30. So  what  about  the  CSS? • This  is  probably  the  least  different  part  of  developing  a  Wordpress   theme  compared  with  a  staJc  website. • The  style.css  sits  in  the  theme  directory  and  is  usually  added  to  the   header.php  with  a  standard  link  tag,  but  with  a  Wordpress  funcJon  in   place  of  the  url. –  <link  rel="stylesheet"  type="text/css"  media="all"  href="<?php   bloginfo(  'stylesheet_url'  );  ?>"  />   • Get  used  to  using  firebug  or  a  similar  html/css  inspecJon  tool  -­‐  it  is  even   more  of  useful  when  working  with  dynamic  websites. 30
  • 31. Installing  the  theme • Wordpress  looks  for  some  pre-­‐defined  text  in  a  comment  block  at  the   top  of  style.css  so  it  can  display  this  informaJon  about  the  theme  in  the   administrator  interface. 31
  • 32. Installing  the  theme • it  also  looks  for  a  file  called  screenshot.png  in   the  template  directory  to  provide  a  preview   thumbnail  of  the  theme 32
  • 33. Installing  the  theme • installing  the  theme  is  simply  a  ma7er  of  pupng  the  theme  folder  in  the   wp-­‐content/themes  directory  and  acJvaJng  it  through  the  Wordpress   admin  interface. 33